|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectShoppingCart
A ShoppingCart keeps track of a customer's purchases.
EStore
Constructor Summary | |
ShoppingCart()
Construct a new empty ShoppingCart. |
Method Summary | |
void |
addItem(Item item)
Add an Item to this ShoppingCart. |
int |
getCost()
What happens when this ShoppingCart is asked the total cost of the Items it contains. |
int |
getCount()
What happens when this ShoppingCart is asked how many Items it contains. |
void |
returnItem(Item item)
Return an Item from this ShoppingCart. |
void |
showContents(Terminal t)
Write the contents of this ShoppingCart to a Terminal. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ShoppingCart()
Method Detail |
public void addItem(Item item)
item
- the Item to add.public int getCost()
public int getCount()
public void returnItem(Item item)
item
- the Item to return.public void showContents(Terminal t)
t
- the Terminal to use for output.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |