View Test Results.
package cs221.groupk.common; import java.util.Date; /** * BoughtItem is used as a class that passes data from the point of sale to * database. When a sale is made, the station will create a new instnace of * BoughtItem, and use it as a parameter to call the registerSale in Disk. * When instantiseing this class, the date and time is automatically logged to * the millisecond, and the saleItem and other information is passed as required. * * <P><I>Code spell-checked - Chris Milner - 5th December 2000.</I><P> * * @author <A HREF="mailto:[email protected]">Paul Smith</A> */ public class BoughtItem { /** * date records the data and time, being set by its Constructor when * instantising BoughtItem. */ protected Date date = new Date(); /** * soldItem references the item being sold and being represented with this * class. */ protected SaleItem soldItem; /** * Default Constructor BoughtItem, not used. */ public BoughtItem() { } /** * Over-loaded BoughtItem Constructor, specifying the saleItem bought. * @param SaleItem saleItem */ public BoughtItem(SaleItem saleItem) { soldItem = saleItem; } /** * getDate returns the Date object for this BoughtItem. * @return Date data of this class being instantised. */ public Date getDate() { return date; } /** * getSaleItem returns the SaleItem for this BoughtItem. * @return SaleItem of this BoughtItem. */ public SaleItem getSaleItem() { return soldItem; } /** * setSaleItem sets this BoughtItem's SaleItem to the SaleItem saleItem. * @param SaleItem saleItem */ public void setSaleItem(SaleItem saleItem) { soldItem = saleItem; } }Page automatically generated on: 26/01/01 at: 10:48:14.