|
|||||||||
| 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. |
private 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, logger, PARTIAL_ATTRIBUTE |
| 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 | |
|---|---|
Player |
getDestination()
Get the Destination value. |
Game |
getGame()
Get the Game value. |
Player |
getSource()
Get the Source value. |
abstract boolean |
isUnique()
Returns whether this TradeItem must be unique. |
abstract boolean |
isValid()
Returns whether this TradeItem is valid. |
abstract 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 |
setDestination(Player newDestination)
Set the Destination value. |
void |
setGame(Game newGame)
Set the Game value. |
void |
setSource(Player newSource)
Set the Source 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 java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private 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 Game getGame()
Game value.
Game valuepublic final void setGame(Game newGame)
Game value.
newGame - The new Game value.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 abstract java.util.List<FreeColGameObject> makeTrade()
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.
public 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.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||