net.sf.freecol.common.model
Class ColonyTradeItem

java.lang.Object
  extended by net.sf.freecol.common.model.PersistentObject
      extended by net.sf.freecol.common.model.TradeItem
          extended by net.sf.freecol.common.model.ColonyTradeItem

public class ColonyTradeItem
extends TradeItem


Field Summary
 
Fields inherited from class net.sf.freecol.common.model.TradeItem
destination, ID, source
 
Fields inherited from class net.sf.freecol.common.model.PersistentObject
COPYRIGHT, LICENSE, REVISION
 
Constructor Summary
ColonyTradeItem(Game game, Player source, Player destination, Colony colony)
           
 
Method Summary
static java.lang.String getXMLElementTagName()
          Gets the tag name of the root element representing this object.
 boolean isValid()
          Returns whether this TradeItem is valid.
 void makeTrade()
          Concludes the trade.
protected  void readFromXMLImpl(javax.xml.stream.XMLStreamReader in)
          Initialize this object from an XML-representation of this object.
 void toXML(javax.xml.stream.XMLStreamWriter out, Player player)
          This method writes an XML-representation of this object to the given stream.
 
Methods inherited from class net.sf.freecol.common.model.TradeItem
getGame, setGame
 
Methods inherited from class net.sf.freecol.common.model.PersistentObject
readFromArrayElement, readFromXML, readFromXMLElement, toArrayElement, toXMLElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColonyTradeItem

public ColonyTradeItem(Game game,
                       Player source,
                       Player destination,
                       Colony colony)
Method Detail

isValid

public boolean isValid()
Description copied from class: TradeItem
Returns whether this TradeItem is valid.

Specified by:
isValid in class TradeItem
Returns:
a boolean value

makeTrade

public void makeTrade()
Description copied from class: TradeItem
Concludes the trade.

Specified by:
makeTrade in class TradeItem

readFromXMLImpl

protected void readFromXMLImpl(javax.xml.stream.XMLStreamReader in)
                        throws javax.xml.stream.XMLStreamException
Initialize this object from an XML-representation of this object.

Overrides:
readFromXMLImpl in class TradeItem
Parameters:
in - The input stream with the XML.
Throws:
javax.xml.stream.XMLStreamException - if a problem was encountered during parsing.

toXML

public void toXML(javax.xml.stream.XMLStreamWriter out,
                  Player player)
           throws javax.xml.stream.XMLStreamException
This method writes an XML-representation of this object to the given stream.

Only attributes visible to the given Player will be added to that representation if showAll is set to false.

Overrides:
toXML in class TradeItem
Parameters:
out - The target stream.
player - The Player this XML-representation should be made for, or null if showAll == true.
Throws:
javax.xml.stream.XMLStreamException - if there are any problems writing to the stream.

getXMLElementTagName

public static java.lang.String getXMLElementTagName()
Gets the tag name of the root element representing this object.

Returns:
"goods".