|
|||||||||
| 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.LastSale
public final class LastSale
This class contains the last sale a player has made, by Settlement and GoodsType.
| Field Summary | |
|---|---|
private int |
price
|
private Turn |
when
|
| 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 | |
|---|---|
LastSale()
Empty constructor for Player. |
|
LastSale(Location where,
GoodsType what,
Turn when,
int price)
Make a new LastSale record. |
|
LastSale(java.lang.String id,
Turn when,
int price)
Make a new LastSale record. |
|
| Method Summary | |
|---|---|
int |
getPrice()
Get the price from the sale. |
Turn |
getWhen()
Get the Turn when the sale was made. |
static java.lang.String |
getXMLElementTagName()
Returns the tag name of the root element representing this object. |
static java.lang.String |
makeKey(Location where,
GoodsType what)
Make a String to be used as a key for looking up sales. |
void |
readFromXMLImpl(javax.xml.stream.XMLStreamReader in)
Initialize this object from an XML-representation of this object. |
java.lang.String |
toString()
Debug helper. |
protected void |
toXMLImpl(javax.xml.stream.XMLStreamWriter out)
This method writes an XML-representation of this object to the given stream. |
protected void |
writeAttributes(javax.xml.stream.XMLStreamWriter out)
Write the children of this object to a stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private Turn when
private int price
| Constructor Detail |
|---|
public LastSale()
public LastSale(Location where,
GoodsType what,
Turn when,
int price)
where - The Location of the sale.what - The GoodsType sold.when - In which Turn the sale occurred.price - The per-unit price of the sale.
public LastSale(java.lang.String id,
Turn when,
int price)
id - The identifier (encoding Settlement and GoodsType).when - In which Turn the sale occurred.price - The per-unit price of the sale.| Method Detail |
|---|
public Turn getWhen()
Turn when the sale was made.
Turn when the sale was made.public int getPrice()
public static java.lang.String makeKey(Location where,
GoodsType what)
where - The Location of the sale.what - The GoodsType sold.
protected 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 with the stream.
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.
public 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 there are any problems with the stream.public java.lang.String toString()
toString in class java.lang.Objectpublic static java.lang.String getXMLElementTagName()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||