Advertisement
Guest User

Untitled

a guest
Dec 11th, 2015
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.99 KB | None | 0 0
  1. /*
  2.  * To change this license header, choose License Headers in Project Properties.
  3.  * To change this template file, choose Tools | Templates
  4.  * and open the template in the editor.
  5.  */
  6. package beans;
  7.  
  8. import FP.TableRow;
  9. import java.util.ArrayList;
  10. import javax.annotation.ManagedBean;
  11. import javax.ejb.Stateless;
  12.  
  13. /**
  14.  *
  15.  * @author aaron
  16.  */
  17. @ManagedBean
  18. public class ShoppingCart {
  19.    
  20.     public ShoppingCart(){
  21.     }
  22.    
  23.     public int sizeOf(){
  24.         int count = cartItems.size();
  25.         return count;
  26.     }
  27.     private ArrayList<FP.TableRow> cartItems = new ArrayList();
  28.  
  29.     /**
  30.      * @return the cartItems
  31.      */
  32.     public ArrayList<FP.TableRow> getCartItems() {
  33.         return cartItems;
  34.     }
  35.  
  36.     /**
  37.      * @param newItem
  38.      */
  39.     public void setCartItems(FP.TableRow newItem) {
  40.         try {
  41.             cartItems.add(newItem);
  42.         } catch (Exception e) {
  43.             System.out.println("Error in setCartItems" + e);
  44.         }
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement