com.ora.jsp.beans.shopping
Class CartBean

java.lang.Object
  extended bycom.ora.jsp.beans.shopping.CartBean
All Implemented Interfaces:
java.io.Serializable

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

This class represents a shopping cart. It holds a list of products.

Version:
2.0
Author:
Hans Bergsten, Gefion software
See Also:
Serialized Form

Field Summary
private  java.util.Vector cart
           
 
Constructor Summary
CartBean()
           
 
Method Summary
 ProductBean[] getProductList()
          Returns the product list.
 float getTotal()
          Returns the total price for all products in the cart
 void setProduct(ProductBean product)
          Adds a product to the cart, if it's not already there.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cart

private java.util.Vector cart
Constructor Detail

CartBean

public CartBean()
Method Detail

setProduct

public void setProduct(ProductBean product)
Adds a product to the cart, if it's not already there.

Parameters:
product - the ProductBean

getProductList

public ProductBean[] getProductList()
Returns the product list.

Returns:
an Iterator of ProductBeans

getTotal

public float getTotal()
Returns the total price for all products in the cart

Returns:
the total price