package cs221.groupk.common;
import java.io.Serializable;
import cs221.groupk.exceptions.database.*;
/**
* SaleItem represents a single perchasable item. The details stored here are
* used to get the price and information about ticket types and gifts when
* making a perchase. Its methods are only accessable through those made public
* in the Disk class.
*
* <P><I>Code spell-checked - Chris Milner - 5th December 2000.</I><P>
*
* @author <A HREF="mailto:[email protected]">Paul Smith</A>
*/
public class SaleItem implements StdSaleItem, Serializable
{
/**itemID is a unique ID for this SaleItem accross the whole system*/
protected int itemID;
/**name of SaleItem*/
protected String name;
/**details of SaleItem*/
protected String details;
/**price of SaleItem*/
protected int price;
/**
* ticketCategory specifies the type of ticket.
* @see Constants
*/
protected int ticketCatagory;
/**
* active specifes if this SaleItem is still available or just for database
* integrity.
*/
protected boolean active;
/**
* isActive returns the value of the active data member. This is used to
* indicate if this SaleItem is available for use, or is held for purposes
* of database normalisation/integrity.
* @return boolean returns true if this SaleItem is active, or false if not.
*/
public boolean isActive()
{
return active;
}
/**
* setActive sets the data member active to the value specified by active.
* @param boolean active sets this SaleItems active data member to the value
* of active
*/
public void setActive(boolean active)
{
this.active = active;
}
/**
* getPrice returns the price of this SaleItem.
*/
public int getPrice()
{
return price;
}
/**
* getItemID returns the ID of this SaleItem.
*/
public int getItemID()
{
return itemID;
}
/**
* getName returns the name of this SaleItem.
*/
public String getName()
{
return name;
}
/**
* getDetails returns the details on this Object.
*/
public String getDetails()
{
return details;
}
/**
* setItemID sets the Items ID for this SaleItem to theItemID.
* @param int theItemID - new Item ID.
* @throws InsufficientAccessPrivilegeException is thrown if a user without
* Admin status attempts to access them, or the current user has not been
* validated.
*/
public void setItemID(int itemID)throws InsufficientAccessPrivilegeException
{
this.itemID = itemID;
}
/**
* setName sets the name for this SaleItem to theName.
* @param String theName - new Item Name.
* @throws InsufficientAccessPrivilegeException is thrown if a user without
* Admin status attempts to access them, or the current user has not been
* validated.
*/
public void setName(String name)throws InsufficientAccessPrivilegeException
{
this.name = name;
}
/**
* setDetails sets the details for this SaleItem to theDetails.
* @param String details - new Item details.
* @throws InsufficientAccessPrivilegeException is thrown if a user without
* Admin status attempts to access them, or the current user has not been
* validated.
*/
public void setDetails(String details)throws InsufficientAccessPrivilegeException
{
this.details = details;
}
/**
* setPrice sets the Items price for this SaleItem to thePrice.
* @param int price - new Item price.
* @throws InsufficientAccessPrivilegeException is thrown if a user without
* Admin status attempts to access them, or the current user has not been
* validated.
*/
public void setPrice(int price)throws InsufficientAccessPrivilegeException
{
this.price = price;
}
/**
* toString returns a string representing this object.
*/
public String toString()
{
return null;
}
}
Page automatically generated on: 28/12/00 at: 7:58:13 PM.