net.sf.freecol.common.model
Class DiplomaticTrade

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

public class DiplomaticTrade
extends PersistentObject

The class DiplomaticTrade represents an offer one player can make another.


Field Summary
static java.lang.String COPYRIGHT
           
static java.lang.String LICENSE
           
static java.lang.String REVISION
           
 
Constructor Summary
DiplomaticTrade(Game game)
           
 
Method Summary
 void add(TradeItem newItem)
          Add a TradeItem to the DiplomaticTrade.
static java.lang.String getXMLElementTagName()
          Gets the tag name of the root element representing this object.
 java.util.Iterator<TradeItem> iterator()
          Returns an iterator for all TradeItems.
protected  void readFromXMLImpl(javax.xml.stream.XMLStreamReader in)
          Initialize this object from an XML-representation of this object.
 void remove(TradeItem newItem)
          Remove a TradeItem from the DiplomaticTrade.
 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.PersistentObject
readFromArrayElement, readFromXML, readFromXMLElement, toArrayElement, toXMLElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COPYRIGHT

public static final java.lang.String COPYRIGHT
See Also:
Constant Field Values

LICENSE

public static final java.lang.String LICENSE
See Also:
Constant Field Values

REVISION

public static final java.lang.String REVISION
See Also:
Constant Field Values
Constructor Detail

DiplomaticTrade

public DiplomaticTrade(Game game)
Method Detail

add

public void add(TradeItem newItem)
Add a TradeItem to the DiplomaticTrade.

Parameters:
newItem - a TradeItem value

remove

public void remove(TradeItem newItem)
Remove a TradeItem from the DiplomaticTrade.

Parameters:
newItem - a TradeItem value

iterator

public java.util.Iterator<TradeItem> iterator()
Returns an iterator for all TradeItems.

Returns:
an iterator for all TradeItems.

readFromXMLImpl

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

Specified by:
readFromXMLImpl in class PersistentObject
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.

Specified by:
toXML in class PersistentObject
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".