|
|||||||||
| 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.AbstractGoods
public class AbstractGoods
Represents a certain amount of a GoodsType. It does not correspond to actual cargo present in a Location. It is intended to represent things such as the amount of Lumber necessary to build something, or the amount of cargo to load at a certain Location.
| Field Summary | |
|---|---|
private int |
amount
Describe amount here. |
private GoodsType |
type
Describe type here. |
| 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 | |
|---|---|
AbstractGoods()
Creates a new AbstractGoods instance. |
|
AbstractGoods(AbstractGoods other)
Creates a new AbstractGoods instance. |
|
AbstractGoods(GoodsType type,
int amount)
Creates a new AbstractGoods instance. |
|
| Method Summary | |
|---|---|
boolean |
equals(AbstractGoods other)
|
int |
getAmount()
Get the Amount value. |
java.lang.String |
getNameKey()
|
GoodsType |
getType()
Get the Type value. |
static java.lang.String |
getXMLElementTagName()
Gets the tag name of the root element representing this object. |
protected void |
readFromXMLImpl(javax.xml.stream.XMLStreamReader in)
Initialize this object from an XML-representation of this object. |
void |
setAmount(int newAmount)
Set the Amount value. |
void |
setType(GoodsType newType)
Set the Type value. |
java.lang.String |
toString()
|
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 attributes 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 GoodsType type
private int amount
| Constructor Detail |
|---|
public AbstractGoods()
AbstractGoods instance.
public AbstractGoods(GoodsType type,
int amount)
AbstractGoods instance.
type - a GoodsType valueamount - an int valuepublic AbstractGoods(AbstractGoods other)
AbstractGoods instance.
other - an AbstractGoods value| Method Detail |
|---|
public final GoodsType getType()
Type value.
GoodsType valuepublic java.lang.String getNameKey()
public final void setType(GoodsType newType)
Type value.
newType - The new Type value.public final int getAmount()
Amount value.
int valuepublic final void setAmount(int newAmount)
Amount value.
newAmount - The new Amount value.public boolean equals(AbstractGoods other)
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.
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.
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 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 | ||||||||