|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.uci.ics.inf111.dvdvendor.app.CheckOutCart
public class CheckOutCart
The CheckOutCart class stores a Vector of Products which the customer has added so far in the transaction.
Field Summary | |
---|---|
private java.util.Vector<Product> |
items
A Vector of Products. |
private double |
totalCost
The cost of the items in the cart |
Constructor Summary | |
---|---|
CheckOutCart()
Creates a new CheckOutCart with an empty item list and 0 cost. |
Method Summary | |
---|---|
void |
addItemToCart(Product newItem)
Add a single item to the cart, and add its cost to the running totals. |
double |
getTotalCost()
Accessor method which returns the cost of the items in the cart. |
java.util.Enumeration<Product> |
listItems()
This method returns an enumeration of the Products in the cart. |
Product |
lookUpItem(Product item)
This method looks up a product in the CheckOutCart. |
void |
setTotalCost(double totalCost)
Accessor method which sets the cost of the items in the cart. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.util.Vector<Product> items
private double totalCost
Constructor Detail |
---|
public CheckOutCart()
Method Detail |
---|
public void setTotalCost(double totalCost)
public double getTotalCost()
public void addItemToCart(Product newItem)
newItem
- public Product lookUpItem(Product item)
item
- The item that represents the product.
public java.util.Enumeration<Product> listItems()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |