FileDocCategorySizeDatePackage
ShoppingCartBean.javaAPI DocJBoss 4.2.11853Fri Jul 13 20:55:08 BST 2007org.jboss.tutorial.stateful.bean

ShoppingCartBean

public class ShoppingCartBean extends Object implements Serializable, ShoppingCart

Fields Summary
private HashMap
cart
Constructors Summary
Methods Summary
public voidbuy(java.lang.String product, int quantity)


        
   
      if (cart.containsKey(product))
      {
         int currq = cart.get(product);
         currq += quantity;
         cart.put(product, currq);
      }
      else
      {
         cart.put(product, quantity);
      }
   
public voidcheckout()

      System.out.println("To be implemented");
   
public java.util.HashMapgetCartContents()

      return cart;