|
|||||||||
| 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.GoodsTradeItem
public class GoodsTradeItem
| Field Summary | |
|---|---|
private Goods |
goods
The goods to change hands. |
private Settlement |
settlement
The settlement where the trade is to take place. |
| Fields inherited from class net.sf.freecol.common.model.TradeItem |
|---|
game |
| Fields inherited from class net.sf.freecol.common.model.FreeColObject |
|---|
ARRAY_SIZE, ID_ATTRIBUTE, ID_ATTRIBUTE_TAG, INFINITY, logger, NO_ID, PARTIAL_ATTRIBUTE, UNDEFINED, VALUE_TAG |
| Constructor Summary | |
|---|---|
GoodsTradeItem(Game game,
Player source,
Player destination,
Goods goods,
Settlement settlement)
Creates a new GoodsTradeItem instance. |
|
GoodsTradeItem(Game game,
javax.xml.stream.XMLStreamReader in)
Creates a new GoodsTradeItem instance. |
|
| Method Summary | |
|---|---|
Goods |
getGoods()
Get the goods to trade. |
Settlement |
getSettlement()
Get the Settlement 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. |
protected void |
readFromXMLImpl(javax.xml.stream.XMLStreamReader in)
Initialize this object from an XML-representation of this object. |
void |
setGoods(Goods goods)
Set the goods to trade. |
void |
setSettlement(Settlement newSettlement)
Set the Settlement value. |
protected void |
toXMLImpl(javax.xml.stream.XMLStreamWriter out)
This method writes an XML-representation of this object to the given stream. |
protected void |
writeAttributes(javax.xml.stream.XMLStreamWriter out)
Write the attributes of this object to a stream. |
protected void |
writeChildren(javax.xml.stream.XMLStreamWriter out)
Write the children of this object to a stream. |
| Methods inherited from class net.sf.freecol.common.model.TradeItem |
|---|
getColony, getDestination, getGold, getSource, getStance, getUnit, setColony, setDestination, setGold, setSource, setStance, setUnit |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private Goods goods
private Settlement settlement
| Constructor Detail |
|---|
public GoodsTradeItem(Game game,
Player source,
Player destination,
Goods goods,
Settlement settlement)
GoodsTradeItem instance.
game - a Game valuesource - a Player valuedestination - a Player valuegoods - a Goods valuesettlement - a Settlement value
public GoodsTradeItem(Game game,
javax.xml.stream.XMLStreamReader in)
throws javax.xml.stream.XMLStreamException
GoodsTradeItem instance.
game - a Game valuein - a XMLStreamReader value
javax.xml.stream.XMLStreamException| Method Detail |
|---|
public final Settlement getSettlement()
Settlement value.
Settlement valuepublic final void setSettlement(Settlement newSettlement)
Settlement value.
newSettlement - The new Settlement value.public boolean isValid()
isValid in class TradeItemboolean valuepublic boolean isUnique()
isUnique in class TradeItemboolean valuepublic Goods getGoods()
getGoods in class TradeItempublic void setGoods(Goods goods)
setGoods in class TradeItemgoods - The new Goods to trade.
protected void toXMLImpl(javax.xml.stream.XMLStreamWriter out)
throws javax.xml.stream.XMLStreamException
toXMLImpl in class FreeColObjectout - The target stream.
javax.xml.stream.XMLStreamException - if there are any problems writing
to the stream.
protected void writeAttributes(javax.xml.stream.XMLStreamWriter out)
throws javax.xml.stream.XMLStreamException
writeAttributes in class TradeItemout - The target stream.
javax.xml.stream.XMLStreamException - if there are any problems writing
to the stream.
protected void writeChildren(javax.xml.stream.XMLStreamWriter out)
throws javax.xml.stream.XMLStreamException
writeChildren in class FreeColObjectout - The target stream.
javax.xml.stream.XMLStreamException - if there are any problems writing
to the stream.
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 static java.lang.String getXMLElementTagName()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||