net.sf.freecol.common.model
Class GoodsType

java.lang.Object
  extended by net.sf.freecol.common.model.FreeColObject
      extended by net.sf.freecol.common.model.FreeColGameObjectType
          extended by net.sf.freecol.common.model.GoodsType

public final class GoodsType
extends FreeColGameObjectType


Field Summary
static int NO_BREEDING
           
static int NO_PRICE
           
 
Fields inherited from class net.sf.freecol.common.model.FreeColObject
ID_ATTRIBUTE_TAG
 
Constructor Summary
GoodsType(int index)
           
 
Method Summary
 int getBreedingNumber()
          Get the BreedingNumber value.
 int getInitialAmount()
           
 int getInitialBuyPrice()
           
 int getInitialSellPrice()
           
 int getPrice()
          Get the Price value.
 int getPriceDifference()
           
 GoodsType getProducedMaterial()
           
 java.util.List<GoodsType> getProductionChain()
          Returns the production chain of the goods type, beginning with a raw material that can not be produced from any other.
 GoodsType getRawMaterial()
           
 GoodsType getStoredAs()
           
 GoodsType inputType()
           
 boolean isBreedable()
          Returns true if this type of Goods is breedable.
 boolean isBuildingMaterial()
          Returns true if this type of goods is required for building a BuildableType.
 boolean isFarmed()
           
 boolean isFoodType()
           
 boolean isImmigrationGoodsType()
          Whether this type of goods causes immigration.
 boolean isImmigrationType()
          Get the ImmigrationType value.
 boolean isLibertyGoodsType()
          Whether this type of goods produces liberty points.
 boolean isLibertyType()
          Get the LibertyType value.
 boolean isMilitaryGoods()
          Get the MilitaryGoods value.
 boolean isNewWorldGoodsType()
           
 boolean isNewWorldLuxuryType()
           
 boolean isRawBuildingMaterial()
          Returns true if this type of goods is required for producing a type of goods required for building a BuildableType.
 boolean isRawMaterial()
           
 boolean isRefined()
           
 boolean isStorable()
           
 boolean isStoredAs()
           
 boolean isTradeGoods()
          Get the TradeGoods value.
 boolean limitIgnored()
           
 GoodsType outputType()
           
 void readAttributes(javax.xml.stream.XMLStreamReader in, Specification specification)
           
 void readChildren(javax.xml.stream.XMLStreamReader in, Specification specification)
           
 void setBreedingNumber(int newBreedingNumber)
          Set the BreedingNumber value.
 void setBuildingMaterial(boolean newBuildingMaterial)
          Set the BuildingMaterial value.
 void setMilitaryGoods(boolean newMilitaryGoods)
          Set the MilitaryGoods value.
 void setPrice(int newPrice)
          Set the Price value.
 void setTradeGoods(boolean newTradeGoods)
          Set the TradeGoods value.
 
Methods inherited from class net.sf.freecol.common.model.FreeColGameObjectType
addAbility, addModifier, getFeatureContainer, getIndex, getModifierSet, hasAbility, hasAbility, readFromXML, setFeatureContainer, setIndex, toString
 
Methods inherited from class net.sf.freecol.common.model.FreeColObject
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAttribute, getAttribute, getAttribute, getAttribute, getId, getPropertyChangeListeners, getPropertyChangeListeners, getXMLElementTagName, hasAttribute, hasListeners, readFromXML, readFromXMLElement, removePropertyChangeListener, removePropertyChangeListener, toXML, toXML, toXML, toXMLElement, toXMLElement, toXMLElement, toXMLElement, toXMLElementPartial, writeAttribute, writeFreeColGameObject
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NO_BREEDING

public static final int NO_BREEDING
See Also:
Constant Field Values

NO_PRICE

public static final int NO_PRICE
See Also:
Constant Field Values
Constructor Detail

GoodsType

public GoodsType(int index)
Method Detail

isRawMaterial

public boolean isRawMaterial()

isRefined

public boolean isRefined()

getRawMaterial

public GoodsType getRawMaterial()

getProducedMaterial

public GoodsType getProducedMaterial()

isFarmed

public boolean isFarmed()

limitIgnored

public boolean limitIgnored()

isNewWorldGoodsType

public boolean isNewWorldGoodsType()

isNewWorldLuxuryType

public boolean isNewWorldLuxuryType()

isImmigrationType

public boolean isImmigrationType()
Get the ImmigrationType value.

Returns:
a boolean value

isLibertyType

public boolean isLibertyType()
Get the LibertyType value.

Returns:
a boolean value

isStorable

public boolean isStorable()

isStoredAs

public boolean isStoredAs()

getStoredAs

public GoodsType getStoredAs()

getInitialAmount

public int getInitialAmount()

getInitialSellPrice

public int getInitialSellPrice()

getInitialBuyPrice

public int getInitialBuyPrice()

getPriceDifference

public int getPriceDifference()

isFoodType

public boolean isFoodType()

outputType

public GoodsType outputType()

inputType

public GoodsType inputType()

isBuildingMaterial

public boolean isBuildingMaterial()
Returns true if this type of goods is required for building a BuildableType.

Returns:
a boolean value
See Also:
BuildableType

setBuildingMaterial

public void setBuildingMaterial(boolean newBuildingMaterial)
Set the BuildingMaterial value.

Parameters:
newBuildingMaterial - The new BuildingMaterial value.

getProductionChain

public java.util.List<GoodsType> getProductionChain()
Returns the production chain of the goods type, beginning with a raw material that can not be produced from any other. The last element of the production chain is the goods type itself.

Returns:
the production chain of the goods type

isRawBuildingMaterial

public boolean isRawBuildingMaterial()
Returns true if this type of goods is required for producing a type of goods required for building a BuildableType.

Returns:
a boolean value
See Also:
BuildableType

isMilitaryGoods

public boolean isMilitaryGoods()
Get the MilitaryGoods value.

Returns:
a boolean value

setMilitaryGoods

public void setMilitaryGoods(boolean newMilitaryGoods)
Set the MilitaryGoods value.

Parameters:
newMilitaryGoods - The new MilitaryGoods value.

isTradeGoods

public boolean isTradeGoods()
Get the TradeGoods value.

Returns:
a boolean value

setTradeGoods

public void setTradeGoods(boolean newTradeGoods)
Set the TradeGoods value.

Parameters:
newTradeGoods - The new TradeGoods value.

isLibertyGoodsType

public boolean isLibertyGoodsType()
Whether this type of goods produces liberty points.

Returns:
a boolean value

isImmigrationGoodsType

public boolean isImmigrationGoodsType()
Whether this type of goods causes immigration.

Returns:
a boolean value

getBreedingNumber

public int getBreedingNumber()
Get the BreedingNumber value.

Returns:
an int value

setBreedingNumber

public void setBreedingNumber(int newBreedingNumber)
Set the BreedingNumber value.

Parameters:
newBreedingNumber - The new BreedingNumber value.

isBreedable

public boolean isBreedable()
Returns true if this type of Goods is breedable. This should only be true for animals, such as horses.

Returns:
a boolean value

getPrice

public int getPrice()
Get the Price value.

Returns:
an int value

setPrice

public void setPrice(int newPrice)
Set the Price value.

Parameters:
newPrice - The new Price value.

readAttributes

public void readAttributes(javax.xml.stream.XMLStreamReader in,
                           Specification specification)
                    throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException

readChildren

public void readChildren(javax.xml.stream.XMLStreamReader in,
                         Specification specification)
                  throws javax.xml.stream.XMLStreamException
Overrides:
readChildren in class FreeColGameObjectType
Throws:
javax.xml.stream.XMLStreamException