/*
 * $Author: bhevans $
 * $Date: 1996/05/26 22:48:10 $
 * $Source: /home/phoenix/cscstd/ijkl/jlarsen/box/RCS/StorageItem.java,v $
 * $Revision: 1.5 $
 * $Log: StorageItem.java,v $
# Revision 1.5  1996/05/26  22:48:10  bhevans
# Matches design doc. better
#
 */

package com.nanosoft.pcm.machine;

/**
 * The StorageItem represents the price, description, and
 * locaton of the product for sale.  The quantities of a
 * particular item type are stored in a separate class in the 
 * StorageUnit (StItem).
 * @see StorageUnit
 * @see StItem
 * @author $Author: bhevans $
 * @version $Revision: 1.5 $
 */
public
class StorageItem extends Object 
{
  private String       selection;
  private String       description;
  private MoneyAmount  price;

  /**
	* @param aSelection The unique keystroke associated with the item.
	* @param aDescription The name of item, should be less than 15 characters.
	* @param aPrice The price of the item, a MoneyAmount.
	* @see MoneyAmount
	*/
  public StorageItem(String aSelection, String aDescription, 
  MoneyAmount aPrice ) {
	  selection = aSelection;
     description = aDescription;
     price = aPrice;
  }

  /**
	* @return The desciption of the product 
	*/
  public String      getName()          { return description; }

  /**
	* @return The keystroke associated with the product
	*/
  public String      getSelectionCode() { return selection; }

  /**
	* @return The price of the product
	*/
  public MoneyAmount getPrice()         { return price; }

  /**
	* @return A dump of the contents within the class
	* i.e., key, description, and price ( for debugging ).
	*/
  public String toString() {
    return "\n"  + 
			  "==> Key Input   : " + selection + "\n" +
           "==> Description : " + description + "\n" +
           "==> Price       : " + price + "\n";
  }

}