SalesPoint v3.3 API

data
Interface StockFromValueCreator

All Known Implementing Classes:
DefaultCountingStockFromValueCreator, StockFromStockCreator, StockFromStockCreatorBT

public interface StockFromValueCreator

Strategy that increases a Stock's total value by adding StockItems that sum up to a given amount.

Since:
v0.5
Author:
Steffen Zschaler
See Also:
Stock.fillStockWithValue(data.DataBasket, data.Value, data.StockFromValueCreator)

Method Summary
 Value fillStock(Stock st, Value v, DataBasket db)
          The actual algorithm.
 

Method Detail

fillStock

Value fillStock(Stock st,
                Value v,
                DataBasket db)
The actual algorithm.

The method should add StockItems to st so that the total value of all these items becomes the biggest value that is smaller or equal v. The difference between v and the actual total value of the added StockItems is to be returned.

To avoid dead-locks, this method must not trigger any threads!

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:
Always

SalesPoint v3.3 API