001 package data;
002
003 /**
004 * Strategy that increases a {@link Stock Stock's} total value by adding {@link StockItem StockItems} that sum
005 * up to a given amount.
006 *
007 * @see Stock#fillStockWithValue
008 *
009 * @author Steffen Zschaler
010 * @version 2.0 18/08/1999
011 * @since v0.5
012 */
013 public interface StockFromValueCreator {
014
015 /**
016 * The actual algorithm.
017 *
018 * <p>The method should add StockItems to <code>st</code> so that the total value of all these items becomes
019 * the biggest value that is smaller or equal <code>v</code>. The difference between <code>v</code> and the
020 * actual total value of the added StockItems is to be returned.</p>
021 *
022 * <p>To avoid dead-locks, this method must not trigger any threads!</p>
023 *
024 * @param st the Stock to which to add the StockItems.
025 * @param v the value to be added to the Stock.
026 * @param db the DataBasket relative to which to perform the operation.
027 *
028 * @override Always
029 */
030 public Value fillStock(Stock st, Value v, DataBasket db);
031
032 }