SalesPoint Framework v3.0

data
Class DefaultCountingStockFromValueCreator

java.lang.Object
  |
  +--data.DefaultCountingStockFromValueCreator

public class DefaultCountingStockFromValueCreator
extends Object
implements StockFromValueCreator

A StockFromValueCreator for CountingStocks.

This StockFromValueCreator assumes a potentially infinite source of available items and adds exactly as many items of each type (i.e. corresponding CatalogItem) as needed to fulfil the requirement.

Hooks:
Add A Value To A Stock's Contents
Since:
v2.0
Source Code:
DefaultCountingStockFromValueCreator.java

Field Summary
protected  CatalogItemValue m_civEvaluator
          The CatalogItemValue used to determine the CatalogItems' values.
 
Constructor Summary
DefaultCountingStockFromValueCreator(CatalogItemValue civ)
          Create a new DefaultCountingStockFromValueCreator.
 
Method Summary
 Value fillStock(Stock st, Value v, DataBasket db)
          This StockFromValueCreator assumes a potentially infinite source of available items and adds exactly as many items of each type (i.e. corresponding CatalogItem) as needed to fulfil the requirement.
static Comparator invertedCIValueOrder(CatalogItemValue civ)
          Helper method that creates a Comparator that orders CatalogItems, highest value first.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_civEvaluator

protected CatalogItemValue m_civEvaluator
The CatalogItemValue used to determine the CatalogItems' values.
Constructor Detail

DefaultCountingStockFromValueCreator

public DefaultCountingStockFromValueCreator(CatalogItemValue civ)
Create a new DefaultCountingStockFromValueCreator.
Parameters:
civ - the CatalogItemValue used to determine the CatalogItems' values.
Method Detail

fillStock

public Value fillStock(Stock st,
                       Value v,
                       DataBasket db)
This StockFromValueCreator assumes a potentially infinite source of available items and adds exactly as many items of each type (i.e. corresponding CatalogItem) as needed to fulfil the requirement.
Override:
Never.
Specified by:
fillStock in interface StockFromValueCreator

invertedCIValueOrder

public static final Comparator invertedCIValueOrder(CatalogItemValue civ)
Helper method that creates a Comparator that orders CatalogItems, highest value first.

SalesPoint Framework v3.0