com.sun.j2ee.blueprints.shoppingcart.cart.model
Class ShoppingCartModel

java.lang.Object
  |
  +--com.sun.j2ee.blueprints.shoppingcart.cart.model.ShoppingCartModel
Direct Known Subclasses:
ShoppingCartWebImpl

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

This class represents the model data for the shopping cart. It is a value object and has fine grained getter methods.

See Also:
Serialized Form

Constructor Summary
ShoppingCartModel(java.util.Collection items)
           
 
Method Summary
 void copy(ShoppingCartModel src)
          copies over the data from the specified shopping cart.
 java.util.Collection getCart()
           
 java.util.Iterator getItems()
           
 int getSize()
           
 double getTotalCost()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShoppingCartModel

public ShoppingCartModel(java.util.Collection items)
Method Detail

getSize

public int getSize()

getCart

public java.util.Collection getCart()
Returns:
an collection of all the CartItems.

getItems

public java.util.Iterator getItems()
Returns:
an iterator over all the CartItems.

getTotalCost

public double getTotalCost()

copy

public void copy(ShoppingCartModel src)
copies over the data from the specified shopping cart. Note that it is a shallow copy.


Copyright © 2000 Sun Microsystems Inc. All Rights Reserved.