|
||||||||||
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 |
---|
Fields inherited from class net.sf.freecol.common.model.FreeColObject |
---|
ID_ATTRIBUTE_TAG |
Constructor Summary | |
---|---|
AbstractGoods()
Creates a new AbstractGoods instance. |
|
AbstractGoods(GoodsType type,
int amount)
Creates a new AbstractGoods instance. |
Method Summary | |
---|---|
int |
getAmount()
Get the Amount value. |
GoodsType |
getType()
Get the Type value. |
static java.lang.String |
getXMLElementTagName()
Gets the tag name of the root element representing 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. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AbstractGoods()
AbstractGoods
instance.
public AbstractGoods(GoodsType type, int amount)
AbstractGoods
instance.
type
- a GoodsType
valueamount
- an int
valueMethod Detail |
---|
public final GoodsType getType()
Type
value.
GoodsType
valuepublic 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 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.public static java.lang.String getXMLElementTagName()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |