|
© 2002 BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.beasys.commerce.foundation.BelongingImpl | +--com.beasys.commerce.ebusiness.shoppingcart.ShoppingCartImpl
The ShoppingCart is used to contain a list of ShoppingCartLines. The ShoppingCart also has a Customer associated with it so that it can calculate Customer dependent prices if necessary.
ShoppingCart
,
ShoppingCartHome
, Serialized FormField Summary | |
Money |
shipping
Containment: By Value Multiplicity: 1:1 |
java.util.Collection |
shoppingCartLines
The shopping cart contains a list of ShoppingCart lines Containment: By Value Multiplicity: 0:N Interface: java.util.Collection |
Money |
subtotal
|
Money |
total
|
Fields inherited from class com.beasys.commerce.foundation.BelongingImpl |
__classIdentifier,
__containingBelonging,
__containingEntity,
__mapKey,
__sequenceNumber,
_isDirty |
Constructor Summary | |
ShoppingCartImpl()
|
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 unitPrice)
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). |
int |
compareTo(java.lang.Object o)
Compare this belonging to another |
boolean |
containsShoppingCartLine(ShoppingCartLine element)
Returns true if this collection contains the specified element. |
boolean |
containsShoppingCartLineCollection(java.util.Collection collection)
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 product items that belong to a category Note This method creates/calls the CatalogManager and the ProductItemManager to resolve which items belong to what category! This means the performance of this method cannot be great, and the method should be used parcimoniously. |
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()
Gets the shipping discount list |
java.util.Collection |
getShoppingCartLineCollection()
Returns a deep copy of 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 |
java.lang.String |
interfaceName()
interfaceName() returns the unqualified name of the interface from the UML model |
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 |
setByValue(Belonging value)
It is possible to call set-by-value with a superclass. |
void |
setOrderDiscountPresentations(java.util.ArrayList orderDiscountPresentations)
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 shippingDiscountPresentations)
Sets the shipping discount list |
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. |
Belonging |
value()
value() is a more typesafe implementation of clone() |
Methods inherited from class java.lang.Object |
finalize,
getClass,
notify,
notifyAll,
wait,
wait,
wait |
Field Detail |
public Money shipping
public Money subtotal
public Money total
public java.util.Collection shoppingCartLines
Constructor Detail |
public ShoppingCartImpl()
Method Detail |
public Money getTotal()
public void setTotal(Money total)
total
- total to be addedpublic Money getSubtotal()
public void setSubtotal(Money subtotal)
subtotal
- subtotal to be addedpublic Money getShipping()
public void setShipping(Money shipping)
shipping
- shipping to be addedpublic java.util.Collection getShoppingCartLineCollection()
public void setShoppingCartLineCollection(java.util.Collection collection)
public boolean addShoppingCartLine(ShoppingCartLine element)
public boolean addShoppingCartLineCollection(java.util.Collection collection)
public void clearShoppingCartLineCollection()
public boolean containsShoppingCartLine(ShoppingCartLine element)
public boolean containsShoppingCartLineCollection(java.util.Collection collection)
public boolean equalsShoppingCartLineCollection(java.lang.Object object)
public int shoppingCartLineCollectionHashCode()
public boolean isShoppingCartLineCollectionEmpty()
public java.util.Iterator shoppingCartLineCollectionIterator()
public boolean removeShoppingCartLine(ShoppingCartLine element)
public boolean removeShoppingCartLineCollection(java.util.Collection collection)
public boolean retainShoppingCartLineCollection(java.util.Collection collection)
public int shoppingCartLineCollectionSize()
public Belonging value()
public java.lang.String interfaceName()
public void setByValue(Belonging value)
It is also possible to call set-by-value with a subclass. In this case, the specialized fields in the subclass will be ignored. The overridden fields in the subclass will be populated.
public int compareTo(java.lang.Object o)
o
- target object for comparisionpublic void addItemsFromShoppingCart(ShoppingCart items) throws InvalidArgumentException
public void setProductItemQuantity(ProductItem item, double quantity) throws InvalidArgumentException
public ProductItem removeProductItem(java.lang.String productIdentifier) throws InvalidArgumentException
productIdentifier,
- (See productItem.getKey( ).getIdentifier( ) )public void removeAllProductItems()
public ShoppingCartLine findShoppingCartLine(java.lang.String productIdentifier) throws ItemNotInShoppingCartException, InvalidArgumentException
productIdentifier,
- (See productItem.getKey( ).getIdentifier( ) )public double getNumberOfUnits()
public double getCategoryQuantity(java.lang.String categoryId) throws java.rmi.RemoteException
categoryId,
- a string that identifies the categorypublic ShoppingCartLine createShoppingCartLine()
public ShoppingCartLine addProductItem(ProductItem item, double quantity) throws InvalidArgumentException
public ShoppingCartLine addProductItem(ProductItem item, double quantity, Money unitPrice) throws InvalidArgumentException
public boolean isEmpty()
public Money getTotal(int totalType) throws InvalidArgumentException
total
- typepublic Money getTotalPrice()
public java.util.ArrayList getShippingDiscountPresentations()
public void setShippingDiscountPresentations(java.util.ArrayList shippingDiscountPresentations)
public java.util.ArrayList getOrderDiscountPresentations()
public void setOrderDiscountPresentations(java.util.ArrayList orderDiscountPresentations)
|
© 2002 BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |