SalesPoint Framework v3.1

data
Class StockFromStockCreatorBT

java.lang.Object
  extended bydata.StockFromStockCreator
      extended bydata.StockFromStockCreatorBT
All Implemented Interfaces:
StockFromValueCreator

public class StockFromStockCreatorBT
extends StockFromStockCreator

A StockFromStockCreator that performs backtracking.

Since:
v0.5
Author:
Steffen Zschaler

Field Summary
protected  List m_lSortedCI
          A sorted list of the CatalogItems in the destination Stock's Catalog.
protected  Map m_mplsiItemsAdded
          A Map of the items that were added.
 
Fields inherited from class data.StockFromStockCreator
m_civEvaluator, m_stSource
 
Constructor Summary
StockFromStockCreatorBT(Stock stSource, CatalogItemValue civ)
          Create a new StockFromStockCreatorBT.
 
Method Summary
protected  Value doFill(int nIdx, Value v, Stock st, DataBasket db)
          Backtracking step method.
 Value fillStock(Stock st, Value v, DataBasket db)
          Fill the destination Stock using the same algorithm as in StockFromStockCreator.fillStock(data.Stock, data.Value, data.DataBasket), but with backtracking.
protected  void undoFill(int nIdx, Value v, Stock st, DataBasket db)
          Backtracking back-step method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_lSortedCI

protected List m_lSortedCI
A sorted list of the CatalogItems in the destination Stock's Catalog.


m_mplsiItemsAdded

protected Map m_mplsiItemsAdded
A Map of the items that were added. Needed for undo operations during backtracking.

Constructor Detail

StockFromStockCreatorBT

public StockFromStockCreatorBT(Stock stSource,
                               CatalogItemValue civ)
Create a new StockFromStockCreatorBT.

Parameters:
stSource - the source Stock.
civ - the CatalogItemValue used to determine the CatalogItems' values.
Method Detail

fillStock

public Value fillStock(Stock st,
                       Value v,
                       DataBasket db)
Fill the destination Stock using the same algorithm as in StockFromStockCreator.fillStock(data.Stock, data.Value, data.DataBasket), but with backtracking.

Specified by:
fillStock in interface StockFromValueCreator
Overrides:
fillStock in class StockFromStockCreator
Override:
Never

doFill

protected Value doFill(int nIdx,
                       Value v,
                       Stock st,
                       DataBasket db)
Backtracking step method.

Override:
Never

undoFill

protected void undoFill(int nIdx,
                        Value v,
                        Stock st,
                        DataBasket db)
Backtracking back-step method.

Override:
Never

SalesPoint Framework v3.1