data
Interface StockFromValueCreator
- All Known Implementing Classes:
- DefaultCountingStockFromValueCreator, StockFromStockCreator
- public interface StockFromValueCreator
Strategy that increases a Stock's total value by adding StockItems that sum
up to a given amount.
- Hooks:
- Add A Value To A Stock's Contents
- Since:
- v0.5
- Version:
- 2.0 18/08/1999
- Author:
- Steffen Zschaler
- See Also:
Stock.fillStockWithValue(data.DataBasket, data.Value, data.StockFromValueCreator)
fillStock
public 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!
- Override:
- Always.
- 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.- Hooks:
- Add A Value To A Stock's Contents