|
||||||||||
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 |
---|
Fields inherited from class net.sf.freecol.common.model.FreeColObject |
---|
ID_ATTRIBUTE_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 | |
---|---|
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. |
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 |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
valuepublic 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()
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.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |