© 2002 BEA Systems, Inc.


com.beasys.commerce.ebusiness.shoppingcart
Interface ShoppingCart

All Known Implementing Classes:
ShoppingCartImpl

public interface ShoppingCart
extends Belonging

The ShoppingCart is used to contain a list of ShoppingCartLines. Each ShoppingCartLine contains a unique item. If the customer adds a ProductItem that is already in the shopping cart, the quantity of the existing ShoppingCartLine is increased.

See Also:
ShoppingCartHome, ShoppingCartLine

Method Summary
 void addItemsFromShoppingCart(ShoppingCart items)
          Add the ShoppingCartLines from the specified ShoppingCart to this ShoppingCart.
 ShoppingCartLine addProductItem(ProductItem item, double quantity)
          Add an Item to the ShoppingCart.
 ShoppingCartLine addProductItem(ProductItem item, double quantity, Money unitMoney)
          Add an Item to the ShoppingCart.
 boolean addShoppingCartLine(ShoppingCartLine element)
          Ensures that this collection contains the specified element (optional operation).
 boolean addShoppingCartLineCollection(java.util.Collection collection)
          Adds all of the elements in the specified collection to this collection (optional operation).
 void clearShoppingCartLineCollection()
          Removes all of the elements from this collection (optional operation).
 boolean containsShoppingCartLine(ShoppingCartLine element)
          Returns true if this collection contains the specified element.
 boolean containsShoppingCartLineCollection(java.util.Collection c)
          Returns true if this collection contains all of the elements in the specified collection.
 ShoppingCartLine createShoppingCartLine()
          Used internally by the ShoppingCart to create ShoppingCartLines.
 boolean equalsShoppingCartLineCollection(java.lang.Object object)
          Compares the specified object with this collection for equality.
 ShoppingCartLine findShoppingCartLine(java.lang.String productIdentifier)
          Find the ShoppingCartLine associated with the specified Item.
 double getCategoryQuantity(java.lang.String categoryId)
          Count the number of products that belong to a category.
 double getNumberOfUnits()
          Count the total quantity of items by summing the quantity on each line.
 java.util.ArrayList getOrderDiscountPresentations()
          Gets the order level discount list
 Money getShipping()
          Get the value of shipping
 java.util.ArrayList getShippingDiscountPresentations()
          Accessor method for the presentation of the discounts applied to the shipping, used by JSP pages for instance
 java.util.Collection getShoppingCartLineCollection()
          Returns the entire collection
 Money getSubtotal()
          Get the value of Subtotal
 Money getTotal()
          Get the value of total
 Money getTotal(int totalType)
          Gets the shopping cart total for the given total type.
 Money getTotalPrice()
          Gets the overal shopping cart total
 boolean isEmpty()
          Returns true if the shopping cart has no items
 boolean isShoppingCartLineCollectionEmpty()
          Returns true if this collection contains no elements.
 void removeAllProductItems()
          Removes all ShoppingCartLines.
 ProductItem removeProductItem(java.lang.String productIdentifier)
          Remove the ShoppingCartLine associated with the Item specified.
 boolean removeShoppingCartLine(ShoppingCartLine element)
          Removes a single instance of the specified element from this collection, if it is present (optional operation).
 boolean removeShoppingCartLineCollection(java.util.Collection collection)
          Removes all this collection's elements that are also contained in the specified collection (optional operation).
 boolean retainShoppingCartLineCollection(java.util.Collection collection)
          Retains only the elements in this collection that are contained in the specified collection (optional operation).
 void setOrderDiscountPresentations(java.util.ArrayList discountPresentations)
          sets the order level discount list
 void setProductItemQuantity(ProductItem item, double quantity)
          Sets the Quantity of the ShoppingCartLine associated with this Item.
 void setShipping(Money shipping)
          Set the value of shipping
 void setShippingDiscountPresentations(java.util.ArrayList discountPresentations)
          sets Order Discount Description
 void setShoppingCartLineCollection(java.util.Collection collection)
          Sets the entire collection
 void setSubtotal(Money subtotal)
          Set the value of subtotal
 void setTotal(Money total)
          Set the value of total
 int shoppingCartLineCollectionHashCode()
          Returns the hash code value for this collection.
 java.util.Iterator shoppingCartLineCollectionIterator()
          Returns an iterator over the elements in this collection.
 int shoppingCartLineCollectionSize()
          Returns the number of elements in this collection.
 
Methods inherited from interface com.beasys.commerce.foundation.Belonging
clone, equals, interfaceName, setByValue, value
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Method Detail

getTotal

public Money getTotal()
Get the value of total

Returns:
total.

setTotal

public void setTotal(Money total)
Set the value of total

Parameters:
subtotal - total to be set

getSubtotal

public Money getSubtotal()
Get the value of Subtotal

Returns:
Subtotal.

setSubtotal

public void setSubtotal(Money subtotal)
Set the value of subtotal

Parameters:
subtotal - subtotal to be set

getShipping

public Money getShipping()
Get the value of shipping

Returns:
shipping.

setShipping

public void setShipping(Money shipping)
Set the value of shipping

Parameters:
shipping - shipping to be set

getShoppingCartLineCollection

public java.util.Collection getShoppingCartLineCollection()
Returns the entire collection


setShoppingCartLineCollection

public void setShoppingCartLineCollection(java.util.Collection collection)
Sets the entire collection


addShoppingCartLine

public boolean addShoppingCartLine(ShoppingCartLine element)
Ensures that this collection contains the specified element (optional operation).


addShoppingCartLineCollection

public boolean addShoppingCartLineCollection(java.util.Collection collection)
Adds all of the elements in the specified collection to this collection (optional operation).


clearShoppingCartLineCollection

public void clearShoppingCartLineCollection()
Removes all of the elements from this collection (optional operation).


containsShoppingCartLine

public boolean containsShoppingCartLine(ShoppingCartLine element)
Returns true if this collection contains the specified element.


containsShoppingCartLineCollection

public boolean containsShoppingCartLineCollection(java.util.Collection c)
Returns true if this collection contains all of the elements in the specified collection.


equalsShoppingCartLineCollection

public boolean equalsShoppingCartLineCollection(java.lang.Object object)
Compares the specified object with this collection for equality.


shoppingCartLineCollectionHashCode

public int shoppingCartLineCollectionHashCode()
Returns the hash code value for this collection.


isShoppingCartLineCollectionEmpty

public boolean isShoppingCartLineCollectionEmpty()
Returns true if this collection contains no elements.


shoppingCartLineCollectionIterator

public java.util.Iterator shoppingCartLineCollectionIterator()
Returns an iterator over the elements in this collection.


removeShoppingCartLine

public boolean removeShoppingCartLine(ShoppingCartLine element)
Removes a single instance of the specified element from this collection, if it is present (optional operation).


removeShoppingCartLineCollection

public boolean removeShoppingCartLineCollection(java.util.Collection collection)
Removes all this collection's elements that are also contained in the specified collection (optional operation).


retainShoppingCartLineCollection

public boolean retainShoppingCartLineCollection(java.util.Collection collection)
Retains only the elements in this collection that are contained in the specified collection (optional operation).


shoppingCartLineCollectionSize

public int shoppingCartLineCollectionSize()
Returns the number of elements in this collection.


addItemsFromShoppingCart

public void addItemsFromShoppingCart(ShoppingCart items)
                              throws InvalidArgumentException
Add the ShoppingCartLines from the specified ShoppingCart to this ShoppingCart.

Throws:
InvalidArgumentException -  

addProductItem

public ShoppingCartLine addProductItem(ProductItem item,
                                       double quantity)
                                throws InvalidArgumentException
Add an Item to the ShoppingCart. If the Item is already in the ShoppingCart, increase its quantity.

Throws:
InvalidArgumentException -  

setProductItemQuantity

public void setProductItemQuantity(ProductItem item,
                                   double quantity)
                            throws InvalidArgumentException
Sets the Quantity of the ShoppingCartLine associated with this Item. A new ShoppingCartLine is created if the Item is not present. This differs from addItem in that this method explicitly sets the absolute Quantity of a ShoppingCartLine rather than incrementing the existing value .

Throws:
InvalidArgumentException -  

removeProductItem

public ProductItem removeProductItem(java.lang.String productIdentifier)
                              throws InvalidArgumentException
Remove the ShoppingCartLine associated with the Item specified.

Parameters:
productIdentifier, - (See productItem.getKey( ).getIdentifier( ) )
Throws:
InvalidArgumentException -  

removeAllProductItems

public void removeAllProductItems()
Removes all ShoppingCartLines. This resets the entire ShoppingCart.


findShoppingCartLine

public ShoppingCartLine findShoppingCartLine(java.lang.String productIdentifier)
                                      throws ItemNotInShoppingCartException,
                                             InvalidArgumentException
Find the ShoppingCartLine associated with the specified Item. Throws an ItemNotInShoppingCartException if the Item cannot be found.

Parameters:
productIdentifier, - (See productItem.getKey( ).getIdentifier( ) )
Throws:
ItemNotInShoppingCartException -  
InvalidArgumentException -  

getNumberOfUnits

public double getNumberOfUnits()
Count the total quantity of items by summing the quantity on each line.


getCategoryQuantity

public double getCategoryQuantity(java.lang.String categoryId)
                           throws java.rmi.RemoteException
Count the number of products that belong to a category.


createShoppingCartLine

public ShoppingCartLine createShoppingCartLine()
Used internally by the ShoppingCart to create ShoppingCartLines. If ShoppingCart is used to manage a list of lines that extend ShoppingCartLine, this method should be overridden to return an instance of the appropiate sub class.


addProductItem

public ShoppingCartLine addProductItem(ProductItem item,
                                       double quantity,
                                       Money unitMoney)
                                throws InvalidArgumentException
Add an Item to the ShoppingCart. If the Item is already in the ShoppingCart, increase its quantity.

Throws:
InvalidArgumentException -  

isEmpty

public boolean isEmpty()
Returns true if the shopping cart has no items


getTotal

public Money getTotal(int totalType)
               throws InvalidArgumentException
Gets the shopping cart total for the given total type. Valid values are one or more of :

Parameters:
total - type
Throws:
InvalidArgumentException -  

getTotalPrice

public Money getTotalPrice()
Gets the overal shopping cart total


getOrderDiscountPresentations

public java.util.ArrayList getOrderDiscountPresentations()
Gets the order level discount list


setOrderDiscountPresentations

public void setOrderDiscountPresentations(java.util.ArrayList discountPresentations)
sets the order level discount list


getShippingDiscountPresentations

public java.util.ArrayList getShippingDiscountPresentations()
Accessor method for the presentation of the discounts applied to the shipping, used by JSP pages for instance


setShippingDiscountPresentations

public void setShippingDiscountPresentations(java.util.ArrayList discountPresentations)
sets Order Discount Description


© 2002 BEA Systems, Inc.

Copyright © 2002 BEA Systems, Inc. All Rights Reserved