package data;

import java.beans.*;
import java.util.*;

/**
  * An item in a {@link Stock}.
  *
  * <p>StockItems describe actually available items. They refer to a {@link CatalogItem} and describe an item
  * of the CatalogItem's type that is actually available in a Shop's storage, on an order form etc.</p>
  *
  * <p><strong>Note</strong> that the name as obtained via {@link Nameable#getName} is used as the StockItem's
  * key when inserting the StockItem in a Stock.</p>
  *
  * <p>Stocks are a special form of StockItems.</p>
  *
  * @author Steffen Zschaler
  * @version 2.0 18/08/1999
  * @since v2.0
  */
public interface StockItem extends Cloneable,
                                   Comparable,
                                   Nameable {

  /**
    * Get the Stock that contains this StockItem.
    *
    * @override Always
    */
  public Stock getStock();

  /**
    * Get the CatalogItem that is associated to this StockItem.
    *
    * @param db the DataBasket that is used for checking visibility.
    *
    * @override Always
    */
  public CatalogItem getAssociatedItem (DataBasket db);

  /**
    * Clone the StockItem.
    *
    * @override Always
    */
  public Object clone();
}