SalesPoint v3.3 API

data
Class StockFromStockCreatorBT

java.lang.Object
  extended by data.StockFromStockCreator
      extended by data.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<CatalogItem> m_lSortedCI
          A sorted list of the CatalogItems in the destination Stock's Catalog.
protected  Map<String,List<StockItem>> 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<CatalogItem> m_lSortedCI
A sorted list of the CatalogItems in the destination Stock's Catalog.


m_mplsiItemsAdded

protected Map<String,List<StockItem>> 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
Parameters:
st - the Stock to which to add the StockItems.
v - the value to be added to the Stock.
db - the DataBasket relative to which to perform the operation.
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 v3.3 API