net.sf.freecol.common.model
Class BuildableType

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.BuildableType
Direct Known Subclasses:
BuildingType, EquipmentType, UnitType

public abstract class BuildableType
extends FreeColGameObjectType

Contains information on buildable types.


Field Summary
private  java.util.List<AbstractGoods> goodsRequired
          A list of AbstractGoods required to build this type.
static java.lang.String NOTHING
           
private  int populationRequired
          The minimum population that a Colony needs in order to build this type.
private  java.util.HashMap<java.lang.String,java.lang.Boolean> requiredAbilities
          Stores the abilities required by this Type.
static int UNDEFINED
           
 
Fields inherited from class net.sf.freecol.common.model.FreeColGameObjectType
featureContainer
 
Fields inherited from class net.sf.freecol.common.model.FreeColObject
ARRAY_SIZE, ID_ATTRIBUTE, ID_ATTRIBUTE_TAG, logger, PARTIAL_ATTRIBUTE
 
Constructor Summary
BuildableType()
           
 
Method Summary
 java.util.Map<java.lang.String,java.lang.Boolean> getAbilitiesRequired()
          Returns the abilities required by this Type.
 int getAmountRequiredOf(GoodsType type)
          Get amount required of given GoodsType
 java.util.List<AbstractGoods> getGoodsRequired()
          Get the GoodsRequired value.
 java.lang.String getGoodsRequiredAsString()
           
 int getPopulationRequired()
          Get the PopulationRequired value.
protected  void readAttributes(javax.xml.stream.XMLStreamReader in, Specification specification)
           
protected  FreeColObject readChild(javax.xml.stream.XMLStreamReader in, Specification specification)
           
 void setGoodsRequired(java.util.List<AbstractGoods> newGoodsRequired)
          Set the GoodsRequired value.
 void setPopulationRequired(int newPopulationRequired)
          Set the PopulationRequired value.
 
Methods inherited from class net.sf.freecol.common.model.FreeColGameObjectType
addAbility, addModifier, getFeatureContainer, getIndex, getModifierSet, hasAbility, hasAbility, readChildren, readFromXML, readFromXMLImpl, setFeatureContainer, setIndex, toString, toXMLImpl
 
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, readAttributes, readChildren, readFromArrayElement, readFromArrayElement, readFromArrayElement, readFromListElement, readFromXML, readFromXMLElement, readFromXMLPartialImpl, removePropertyChangeListener, removePropertyChangeListener, setId, toArrayElement, toArrayElement, toListElement, toXML, toXML, toXML, toXMLElement, toXMLElement, toXMLElement, toXMLElement, toXMLElementPartial, toXMLPartialImpl, writeAttribute, writeAttributes, writeChildren, writeFreeColGameObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNDEFINED

public static final int UNDEFINED
See Also:
Constant Field Values

NOTHING

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

populationRequired

private int populationRequired
The minimum population that a Colony needs in order to build this type.


goodsRequired

private java.util.List<AbstractGoods> goodsRequired
A list of AbstractGoods required to build this type.


requiredAbilities

private final java.util.HashMap<java.lang.String,java.lang.Boolean> requiredAbilities
Stores the abilities required by this Type.

Constructor Detail

BuildableType

public BuildableType()
Method Detail

getGoodsRequiredAsString

public java.lang.String getGoodsRequiredAsString()

getGoodsRequired

public final java.util.List<AbstractGoods> getGoodsRequired()
Get the GoodsRequired value.

Returns:
a List value

getAmountRequiredOf

public final int getAmountRequiredOf(GoodsType type)
Get amount required of given GoodsType


setGoodsRequired

public final void setGoodsRequired(java.util.List<AbstractGoods> newGoodsRequired)
Set the GoodsRequired value.

Parameters:
newGoodsRequired - The new GoodsRequired value.

getPopulationRequired

public int getPopulationRequired()
Get the PopulationRequired value.

Returns:
an int value

setPopulationRequired

public void setPopulationRequired(int newPopulationRequired)
Set the PopulationRequired value.

Parameters:
newPopulationRequired - The new PopulationRequired value.

getAbilitiesRequired

public java.util.Map<java.lang.String,java.lang.Boolean> getAbilitiesRequired()
Returns the abilities required by this Type.

Returns:
the abilities required by this Type.

readAttributes

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

readChild

protected FreeColObject readChild(javax.xml.stream.XMLStreamReader in,
                                  Specification specification)
                           throws javax.xml.stream.XMLStreamException
Overrides:
readChild in class FreeColGameObjectType
Throws:
javax.xml.stream.XMLStreamException