com.ibm.websphere.samples.pbw.ejb
Class ShoppingCartContent

java.lang.Object
  extended by com.ibm.websphere.samples.pbw.ejb.ShoppingCartContent
All Implemented Interfaces:
Serializable

public class ShoppingCartContent
extends Object
implements Serializable

A class to hold a shopping cart's contents.

See Also:
Serialized Form

Constructor Summary
ShoppingCartContent()
           
 
Method Summary
 void addItem(Inventory si)
          Add the item to the shopping cart.
 String getInventoryID(int index)
          Return the inventory ID at the index given.
 int getQuantity(String inventoryID)
          Return the quantity for the inventory ID given.
 void removeItem(Inventory si)
          Remove the item from the shopping cart.
 int size()
          Return the number of items in the cart.
 void updateItem(Inventory 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

ShoppingCartContent

public ShoppingCartContent()
Method Detail

addItem

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


updateItem

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


removeItem

public void removeItem(Inventory 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 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(String inventoryID)
Return the quantity for the inventory ID given.

Returns:
The quantity for the inventory ID given..


Copyright © 2011. All Rights Reserved.