|
|||||||||
| 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.TradeItem
net.sf.freecol.common.model.UnitTradeItem
public class UnitTradeItem
| Field Summary | |
|---|---|
private Unit |
unit
The unit to change hands. |
| Fields inherited from class net.sf.freecol.common.model.FreeColObject |
|---|
ARRAY_SIZE, ID_ATTRIBUTE, ID_ATTRIBUTE_TAG, logger, PARTIAL_ATTRIBUTE |
| Constructor Summary | |
|---|---|
UnitTradeItem(Game game,
Player source,
Player destination,
Unit unit)
Creates a new UnitTradeItem instance. |
|
UnitTradeItem(Game game,
javax.xml.stream.XMLStreamReader in)
Creates a new UnitTradeItem instance. |
|
| Method Summary | |
|---|---|
Unit |
getUnit()
Get the Unit value. |
static java.lang.String |
getXMLElementTagName()
Gets the tag name of the root element representing this object. |
boolean |
isUnique()
Returns whether this TradeItem must be unique. |
boolean |
isValid()
Returns whether this TradeItem is valid. |
java.util.List<FreeColGameObject> |
makeTrade()
Concludes the trade. |
protected void |
readFromXMLImpl(javax.xml.stream.XMLStreamReader in)
Initialize this object from an XML-representation of this object. |
void |
setUnit(Unit newUnit)
Set the Unit value. |
void |
toXMLImpl(javax.xml.stream.XMLStreamWriter out)
This method writes an XML-representation of this object to the given stream. |
| Methods inherited from class net.sf.freecol.common.model.TradeItem |
|---|
getDestination, getGame, getSource, setDestination, setGame, setSource |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private Unit unit
| Constructor Detail |
|---|
public UnitTradeItem(Game game,
Player source,
Player destination,
Unit unit)
UnitTradeItem instance.
game - a Game valuesource - a Player valuedestination - a Player valueunit - an Unit value
public UnitTradeItem(Game game,
javax.xml.stream.XMLStreamReader in)
throws javax.xml.stream.XMLStreamException
UnitTradeItem instance.
game - a Game valuein - a XMLStreamReader value
javax.xml.stream.XMLStreamException| Method Detail |
|---|
public final Unit getUnit()
Unit value.
Unit valuepublic final void setUnit(Unit newUnit)
Unit value.
newUnit - The new Unit value.public boolean isValid()
isValid in class TradeItemboolean valuepublic boolean isUnique()
isUnique in class TradeItemboolean valuepublic java.util.List<FreeColGameObject> makeTrade()
makeTrade in class TradeItem
protected void readFromXMLImpl(javax.xml.stream.XMLStreamReader in)
throws javax.xml.stream.XMLStreamException
readFromXMLImpl in class TradeItemin - 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
toXMLImpl in class TradeItemout - 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 | ||||||||