net.sf.freecol.server.ai
Class ProductionCache

java.lang.Object
  extended by net.sf.freecol.server.ai.ProductionCache

public class ProductionCache
extends java.lang.Object


Nested Class Summary
 class ProductionCache.Entry
           
 
Field Summary
private  java.util.List<ProductionCache.Entry> assigned
          The assigned entries.
private  Colony colony
           
private  java.util.Set<ColonyTile> colonyTiles
          The available colony tiles.
private static java.util.Comparator<ProductionCache.Entry> defaultComparator
          Compares entries by production.
private  java.util.Map<GoodsType,java.util.List<ProductionCache.Entry>> entries
          Sorted entries per goods type.
private static java.util.Comparator<ProductionCache.Entry> marketValueComparator
          Compares entries by market value of production.
private  java.util.List<ProductionCache.Entry> reserved
          The reserved entries.
private  int unitCount
          The number of units available.
private  TypeCountMap<BuildingType> unitCounts
          The number of Units in various buildings.
private  java.util.Set<Unit> units
          The units available in the colony.
 
Constructor Summary
ProductionCache(Colony colony)
           
 
Method Summary
 void assign(ProductionCache.Entry entry)
           
private  java.util.List<ProductionCache.Entry> createEntries(GoodsType goodsType)
           
 int decrementUnitCount(BuildingType buildingType)
           
 java.util.List<ProductionCache.Entry> getAssigned()
           
 java.util.List<ProductionCache.Entry> getEntries(GoodsType goodsType)
           
 java.util.List<ProductionCache.Entry> getEntries(java.util.List<GoodsType> goodsTypes)
           
 java.util.List<ProductionCache.Entry> getEntries(java.util.List<GoodsType> goodsTypes, boolean useMarketValues)
           
 java.util.List<ProductionCache.Entry> getReserved()
           
 int getUnitCount()
           
 int getUnitCount(BuildingType buildingType)
           
 java.util.Set<Unit> getUnits()
           
static java.util.List<ProductionCache.Entry> removeEntries(Unit unit, WorkLocation workLocation, java.util.List<ProductionCache.Entry> entryList)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

colony

private final Colony colony

units

private final java.util.Set<Unit> units
The units available in the colony.


colonyTiles

private final java.util.Set<ColonyTile> colonyTiles
The available colony tiles.


entries

private final java.util.Map<GoodsType,java.util.List<ProductionCache.Entry>> entries
Sorted entries per goods type.


assigned

private final java.util.List<ProductionCache.Entry> assigned
The assigned entries.


reserved

private final java.util.List<ProductionCache.Entry> reserved
The reserved entries.


defaultComparator

private static final java.util.Comparator<ProductionCache.Entry> defaultComparator
Compares entries by production.


marketValueComparator

private static final java.util.Comparator<ProductionCache.Entry> marketValueComparator
Compares entries by market value of production.


unitCount

private int unitCount
The number of units available.


unitCounts

private TypeCountMap<BuildingType> unitCounts
The number of Units in various buildings.

Constructor Detail

ProductionCache

public ProductionCache(Colony colony)
Method Detail

createEntries

private java.util.List<ProductionCache.Entry> createEntries(GoodsType goodsType)

getUnits

public java.util.Set<Unit> getUnits()

getUnitCount

public int getUnitCount()

getUnitCount

public int getUnitCount(BuildingType buildingType)

decrementUnitCount

public int decrementUnitCount(BuildingType buildingType)

getAssigned

public java.util.List<ProductionCache.Entry> getAssigned()

getReserved

public java.util.List<ProductionCache.Entry> getReserved()

getEntries

public java.util.List<ProductionCache.Entry> getEntries(GoodsType goodsType)

getEntries

public java.util.List<ProductionCache.Entry> getEntries(java.util.List<GoodsType> goodsTypes)

getEntries

public java.util.List<ProductionCache.Entry> getEntries(java.util.List<GoodsType> goodsTypes,
                                                        boolean useMarketValues)

assign

public void assign(ProductionCache.Entry entry)

removeEntries

public static java.util.List<ProductionCache.Entry> removeEntries(Unit unit,
                                                                  WorkLocation workLocation,
                                                                  java.util.List<ProductionCache.Entry> entryList)