package data;

/**
  * Strategy that increases a {@link Stock Stock's} total value by adding {@link StockItem StockItems} that sum
  * up to a given amount.
  *
  * @see Stock#fillStockWithValue
  *
  * @author Steffen Zschaler
  * @version 2.0 18/08/1999
  * @since v0.5
  */
public interface StockFromValueCreator {

  /**
    * The actual algorithm.
    *
    * <p>The method should add StockItems to <code>st</code> so that the total value of all these items becomes
    * the biggest value that is smaller or equal <code>v</code>. The difference between <code>v</code> and the
    * actual total value of the added StockItems is to be returned.</p>
    *
    * <p>To avoid dead-locks, this method must not trigger any threads!</p>
    *
    * @param st the Stock to which to add the StockItems.
    * @param v the value to be added to the Stock.
    * @param db the DataBasket relative to which to perform the operation.
    *
    * @override Always
    */
  public Value fillStock (Stock st, Value v, DataBasket db);

}