|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.freecol.common.model.FreeColObject
net.sf.freecol.common.model.AbstractUnit
public class AbstractUnit
Contains the information necessary to create a new unit.
Field Summary |
---|
Fields inherited from class net.sf.freecol.common.model.FreeColObject |
---|
ID_ATTRIBUTE_TAG |
Constructor Summary | |
---|---|
AbstractUnit()
|
|
AbstractUnit(java.lang.String id,
Unit.Role someRole,
int someNumber)
|
|
AbstractUnit(UnitType unitType,
Unit.Role someRole,
int someNumber)
|
|
AbstractUnit(javax.xml.stream.XMLStreamReader in)
Creates a new AbstractUnit instance. |
Method Summary | |
---|---|
EquipmentType[] |
getEquipment()
Returns the Equipment necessary to create a Unit with the same type and role as this AbstractUnit. |
int |
getNumber()
Get the Number value. |
Unit.Role |
getRole()
Get the Role value. |
UnitType |
getUnitType()
Get the UnitType value. |
static java.lang.String |
getXMLElementTagName()
|
void |
readFromXMLImpl(javax.xml.stream.XMLStreamReader in)
Initialize this object from an XML-representation of this object. |
void |
setNumber(int newNumber)
Set the Number value. |
void |
setRole(Unit.Role newRole)
Set the Role value. |
java.lang.String |
toString()
|
void |
toXMLImpl(javax.xml.stream.XMLStreamWriter out)
This method writes an XML-representation of this object to the given stream. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AbstractUnit()
public AbstractUnit(java.lang.String id, Unit.Role someRole, int someNumber)
public AbstractUnit(UnitType unitType, Unit.Role someRole, int someNumber)
public AbstractUnit(javax.xml.stream.XMLStreamReader in) throws javax.xml.stream.XMLStreamException
AbstractUnit
instance.
in
- a XMLStreamReader
value
javax.xml.stream.XMLStreamException
- if an error occursMethod Detail |
---|
public final UnitType getUnitType()
UnitType
value.
UnitType
valuepublic final Unit.Role getRole()
Role
value.
Role
valuepublic final void setRole(Unit.Role newRole)
Role
value.
newRole
- The new Role value.public final int getNumber()
Number
value.
int
valuepublic final void setNumber(int newNumber)
Number
value.
newNumber
- The new Number value.public EquipmentType[] getEquipment()
EquipmentType[]
valuepublic java.lang.String toString()
toString
in class java.lang.Object
public final void readFromXMLImpl(javax.xml.stream.XMLStreamReader in) throws javax.xml.stream.XMLStreamException
in
- The input stream with the XML.
javax.xml.stream.XMLStreamException
- if a problem was encountered
during parsing.public void toXMLImpl(javax.xml.stream.XMLStreamWriter out) throws javax.xml.stream.XMLStreamException
out
- The target stream.
javax.xml.stream.XMLStreamException
- if there are any problems writing
to the stream.public static java.lang.String getXMLElementTagName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |