|
|||||||||
| 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
public abstract class TradeItem
One of the items a DiplomaticTrade consists of.
| Field Summary | |
|---|---|
private Player |
destination
The player who is to receive this item. |
protected Game |
game
The game this TradeItem belongs to. |
private Player |
source
The player who is to provide this item. |
| 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 | |
|---|---|
TradeItem(Game game,
java.lang.String id,
Player source,
Player destination)
Creates a new TradeItem instance. |
|
TradeItem(Game game,
javax.xml.stream.XMLStreamReader in)
Creates a new TradeItem instance. |
|
| Method Summary | |
|---|---|
Colony |
getColony()
Get the colony to trade. |
Player |
getDestination()
Get the Destination value. |
int |
getGold()
Get the gold to trade. |
Goods |
getGoods()
Get the goods to trade. |
Player |
getSource()
Get the Source value. |
Player.Stance |
getStance()
Get the stance to trade. |
Unit |
getUnit()
Get the unit to trade. |
abstract boolean |
isUnique()
Returns whether this TradeItem must be unique. |
abstract 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 |
setColony(Colony colony)
Set the colony to trade. |
void |
setDestination(Player newDestination)
Set the Destination value. |
void |
setGold(int gold)
Set the gold to trade. |
void |
setGoods(Goods goods)
Set the goods to trade. |
void |
setSource(Player newSource)
Set the Source value. |
void |
setStance(Player.Stance stance)
Set the stance to trade. |
void |
setUnit(Unit unit)
Set the unit to trade. |
protected void |
writeAttributes(javax.xml.stream.XMLStreamWriter out)
Write the attributes of this object to a stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Game game
private Player source
private Player destination
| Constructor Detail |
|---|
public TradeItem(Game game,
java.lang.String id,
Player source,
Player destination)
TradeItem instance.
game - a Game valueid - a String valuesource - a Player valuedestination - a Player value
public TradeItem(Game game,
javax.xml.stream.XMLStreamReader in)
throws javax.xml.stream.XMLStreamException
TradeItem instance.
game - a Game valuein - a XMLStreamReader value
javax.xml.stream.XMLStreamException| Method Detail |
|---|
public final Player getSource()
Source value.
Player valuepublic final void setSource(Player newSource)
Source value.
newSource - The new Source value.public final Player getDestination()
Destination value.
Player valuepublic final void setDestination(Player newDestination)
Destination value.
newDestination - The new Destination value.public abstract boolean isValid()
boolean valuepublic abstract boolean isUnique()
boolean valuepublic Colony getColony()
public void setColony(Colony colony)
colony - The new Colony to trade.public Goods getGoods()
public void setGoods(Goods goods)
goods - The new Goods to trade.public int getGold()
public void setGold(int gold)
gold - The new gold value.public Player.Stance getStance()
public void setStance(Player.Stance stance)
stance - The new Stance to trade.public Unit getUnit()
public void setUnit(Unit unit)
unit - The new Unit to trade.
protected void writeAttributes(javax.xml.stream.XMLStreamWriter out)
throws javax.xml.stream.XMLStreamException
writeAttributes 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 FreeColObjectin - The input stream with the XML.
javax.xml.stream.XMLStreamException - if a problem was encountered
during parsing.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||