Order the Book

coreservlets
Class ItemOrder

java.lang.Object
  |
  +--coreservlets.ItemOrder

public class ItemOrder
extends Object

Associates a catalog Item with a specific order by keeping track of the number ordered and the total price. Also provides some convenience methods to get at the Item data without first extracting the Item separately.

Taken from Core Servlets and JavaServer Pages from Prentice Hall and Sun Microsystems Press, http://www.coreservlets.com/. © 2000 Marty Hall; may be freely used or adapted.


Constructor Summary
ItemOrder(Item item)
           
 
Method Summary
 void cancelOrder()
           
 Item getItem()
           
 String getItemID()
           
 String getLongDescription()
           
 int getNumItems()
           
 String getShortDescription()
           
 double getTotalCost()
           
 double getUnitCost()
           
 void incrementNumItems()
           
protected  void setItem(Item item)
           
 void setNumItems(int n)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ItemOrder

public ItemOrder(Item item)
Method Detail

getItem

public Item getItem()

setItem

protected void setItem(Item item)

getItemID

public String getItemID()

getShortDescription

public String getShortDescription()

getLongDescription

public String getLongDescription()

getUnitCost

public double getUnitCost()

getNumItems

public int getNumItems()

setNumItems

public void setNumItems(int n)

incrementNumItems

public void incrementNumItems()

cancelOrder

public void cancelOrder()

getTotalCost

public double getTotalCost()

Order the Book

Order
CSAJSP @ amazon.com

Return to Top-Level Source Code Archive