com.ibm.websphere.samples.plantsbywebsphereejb
Class ShoppingCartContents

java.lang.Object
  extended by com.ibm.websphere.samples.plantsbywebsphereejb.ShoppingCartContents
All Implemented Interfaces:
java.io.Serializable

public class ShoppingCartContents
extends java.lang.Object
implements java.io.Serializable

A class to hold a shopping cart's contents.

See Also:
Serialized Form

Constructor Summary
ShoppingCartContents()
           
 
Method Summary
 void addItem(ShoppingCartItem si)
          Add the item to the shopping cart.
 java.lang.String getInventoryID(int index)
          Return the inventory ID at the index given.
 int getQuantity(java.lang.String inventoryID)
          Return the quantity for the inventory ID given.
 void removeItem(ShoppingCartItem si)
          Remove the item from the shopping cart.
 int size()
          Return the number of items in the cart.
 void updateItem(ShoppingCartItem si)
          Update the item in the shopping cart.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShoppingCartContents

public ShoppingCartContents()
Method Detail

addItem

public void addItem(ShoppingCartItem si)
Add the item to the shopping cart.


updateItem

public void updateItem(ShoppingCartItem si)
Update the item in the shopping cart.


removeItem

public void removeItem(ShoppingCartItem si)
Remove the item from the shopping cart.


size

public int size()
Return the number of items in the cart.

Returns:
The number of items in the cart.

getInventoryID

public java.lang.String getInventoryID(int index)
Return the inventory ID at the index given. The first element is at index 0, the second at index 1, and so on.

Returns:
The inventory ID at the index, or NULL if not present.

getQuantity

public int getQuantity(java.lang.String inventoryID)
Return the quantity for the inventory ID given.

Returns:
The quantity for the inventory ID given..