|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ShoppingCart
A ShoppingCart keeps track of a customer's purchases.
EStore
Constructor Summary | |
ShoppingCart()
Construct a new empty ShoppingCart. |
Method Summary | |
void |
add(Item purchase)
When this ShoppingCart is asked to add an Item to itself it updates its count field and then updates its cost field by sending the Item a getCost message. |
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. |
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 add(Item purchase)
purchase
- the Item being added to this ShoppingCart.public int getCost()
public int getCount()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |