net.sf.freecol.server.ai
Class ProductionCache.Entry

java.lang.Object
  extended by net.sf.freecol.server.ai.ProductionCache.Entry
Enclosing class:
ProductionCache

public class ProductionCache.Entry
extends java.lang.Object

An Entry in the production cache represents a single unit producing goods in a certain work location. It records information on the type and amount of goods produced, as well as on whether the unit is an expert for producing this type of goods, or can be upgraded to one.


Field Summary
private  GoodsType goodsType
           
private  boolean isExpert
           
private  boolean isOtherExpert
           
private  int production
           
private  Unit unit
           
private  boolean unitUpgrades
           
private  boolean unitUpgradesToExpert
           
private  WorkLocation workLocation
           
 
Constructor Summary
ProductionCache.Entry(GoodsType g, WorkLocation w, Unit u)
           
 
Method Summary
 GoodsType getGoodsType()
          Returns the type of goods produced.
 int getProduction()
          Returns the amount of goods produced.
 Unit getUnit()
          Returns a unit producing goods in this work location.
 WorkLocation getWorkLocation()
          Returns the work location where goods are produced.
 boolean isExpert()
          Returns true if the unit is an expert for producing the type of goods selected.
 boolean isOtherExpert()
          Returns true if the unit is an expert for producing a type of goods other than the one selected.
 java.lang.String toString()
          Returns a string representation of this entry.
 boolean unitUpgrades()
          Returns true if the unit can be upgraded through experience.
 boolean unitUpgradesToExpert()
          Returns true if the unit can be upgraded to an expert for producing the type of goods selected through experience.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

goodsType

private final GoodsType goodsType

workLocation

private final WorkLocation workLocation

unit

private final Unit unit

production

private final int production

isExpert

private boolean isExpert

isOtherExpert

private boolean isOtherExpert

unitUpgrades

private boolean unitUpgrades

unitUpgradesToExpert

private boolean unitUpgradesToExpert
Constructor Detail

ProductionCache.Entry

public ProductionCache.Entry(GoodsType g,
                             WorkLocation w,
                             Unit u)
Method Detail

getGoodsType

public GoodsType getGoodsType()
Returns the type of goods produced.

Returns:
a GoodsType value

getWorkLocation

public WorkLocation getWorkLocation()
Returns the work location where goods are produced.

Returns:
a WorkLocation value

getUnit

public Unit getUnit()
Returns a unit producing goods in this work location.

Returns:
an Unit value

getProduction

public int getProduction()
Returns the amount of goods produced.

Returns:
an int value

isExpert

public boolean isExpert()
Returns true if the unit is an expert for producing the type of goods selected.

Returns:
a boolean value

isOtherExpert

public boolean isOtherExpert()
Returns true if the unit is an expert for producing a type of goods other than the one selected.

Returns:
a boolean value

unitUpgrades

public boolean unitUpgrades()
Returns true if the unit can be upgraded through experience.

Returns:
a boolean value

unitUpgradesToExpert

public boolean unitUpgradesToExpert()
Returns true if the unit can be upgraded to an expert for producing the type of goods selected through experience.

Returns:
a boolean value

toString

public java.lang.String toString()
Returns a string representation of this entry.

Overrides:
toString in class java.lang.Object
Returns:
a String value