com.ora.jsp.beans.shopping
Class CartBean

java.lang.Object
  |
  +--com.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:
1.0
Author:
Hans Bergsten, Gefion software
See Also:
Serialized Form

Field Summary
private  java.util.Vector cart
           
 
Constructor Summary
CartBean()
           
 
Method Summary
 java.util.Enumeration getProducts()
          Returns the product list.
 float getTotal()
          Returns the total price for all products in the cart
 boolean isEmpty()
          Returns true if the cart is empty
 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, registerNatives, 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

getProducts

public java.util.Enumeration getProducts()
Returns the product list.
Returns:
an Enumeration of ProductBeans

getTotal

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

isEmpty

public boolean isEmpty()
Returns true if the cart is empty
Returns:
true if the cart is empty