|
© 2005 BEA Systems, Inc. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.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 |
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(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(Object o)
Compare this belonging to another |
boolean |
containsShoppingCartLine(ShoppingCartLine element)
Returns true if this collection contains the specified element. |
boolean |
containsShoppingCartLineCollection(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(Object object)
Compares the specified object with this collection for equality. |
ShoppingCartLine |
findShoppingCartLine(String productIdentifier)
Find the ShoppingCartLine associated with the specified Item. |
double |
getCategoryQuantity(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! |
double |
getNumberOfUnits()
Count the total quantity of items by summing the quantity on each line. |
ArrayList |
getOrderDiscountPresentations()
Gets the order level discount list |
Money |
getShipping()
Get the value of shipping |
ArrayList |
getShippingDiscountPresentations()
Gets the shipping discount list |
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 |
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(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(Collection collection)
Removes all this collection's elements that are also contained in the specified collection (optional operation). |
boolean |
retainShoppingCartLineCollection(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(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(ArrayList shippingDiscountPresentations)
Sets the shipping discount list |
void |
setShoppingCartLineCollection(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. |
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 |
Methods inherited from interface com.beasys.commerce.foundation.Belonging |
clone, equals |
Field Detail |
public Money shipping
public Collection shoppingCartLines
public Money subtotal
public Money total
Constructor Detail |
public ShoppingCartImpl()
Method Detail |
public void addItemsFromShoppingCart(ShoppingCart items) throws InvalidArgumentException
addItemsFromShoppingCart
in interface ShoppingCart
InvalidArgumentException
public ShoppingCartLine addProductItem(ProductItem item, double quantity) throws InvalidArgumentException
addProductItem
in interface ShoppingCart
InvalidArgumentException
public ShoppingCartLine addProductItem(ProductItem item, double quantity, Money unitPrice) throws InvalidArgumentException
addProductItem
in interface ShoppingCart
InvalidArgumentException
public boolean addShoppingCartLine(ShoppingCartLine element)
addShoppingCartLine
in interface ShoppingCart
public boolean addShoppingCartLineCollection(Collection collection)
addShoppingCartLineCollection
in interface ShoppingCart
public void clearShoppingCartLineCollection()
clearShoppingCartLineCollection
in interface ShoppingCart
public int compareTo(Object o)
compareTo
in interface Comparable
compareTo
in class BelongingImpl
o
- target object for comparision
public boolean containsShoppingCartLine(ShoppingCartLine element)
containsShoppingCartLine
in interface ShoppingCart
public boolean containsShoppingCartLineCollection(Collection collection)
containsShoppingCartLineCollection
in interface ShoppingCart
public ShoppingCartLine createShoppingCartLine()
createShoppingCartLine
in interface ShoppingCart
public boolean equalsShoppingCartLineCollection(Object object)
equalsShoppingCartLineCollection
in interface ShoppingCart
public ShoppingCartLine findShoppingCartLine(String productIdentifier) throws ItemNotInShoppingCartException, InvalidArgumentException
findShoppingCartLine
in interface ShoppingCart
ItemNotInShoppingCartException
InvalidArgumentException
public double getCategoryQuantity(String categoryId) throws RemoteException
getCategoryQuantity
in interface ShoppingCart
RemoteException
public double getNumberOfUnits()
getNumberOfUnits
in interface ShoppingCart
public ArrayList getOrderDiscountPresentations()
getOrderDiscountPresentations
in interface ShoppingCart
public Money getShipping()
getShipping
in interface ShoppingCart
public ArrayList getShippingDiscountPresentations()
getShippingDiscountPresentations
in interface ShoppingCart
public Collection getShoppingCartLineCollection()
getShoppingCartLineCollection
in interface ShoppingCart
public Money getSubtotal()
getSubtotal
in interface ShoppingCart
public Money getTotal()
getTotal
in interface ShoppingCart
public Money getTotal(int totalType) throws InvalidArgumentException
getTotal
in interface ShoppingCart
InvalidArgumentException
public Money getTotalPrice()
getTotalPrice
in interface ShoppingCart
public String interfaceName()
interfaceName
in interface Belonging
public boolean isEmpty()
isEmpty
in interface ShoppingCart
public boolean isShoppingCartLineCollectionEmpty()
isShoppingCartLineCollectionEmpty
in interface ShoppingCart
public void removeAllProductItems()
removeAllProductItems
in interface ShoppingCart
public ProductItem removeProductItem(String productIdentifier) throws InvalidArgumentException
removeProductItem
in interface ShoppingCart
InvalidArgumentException
public boolean removeShoppingCartLine(ShoppingCartLine element)
removeShoppingCartLine
in interface ShoppingCart
public boolean removeShoppingCartLineCollection(Collection collection)
removeShoppingCartLineCollection
in interface ShoppingCart
public boolean retainShoppingCartLineCollection(Collection collection)
retainShoppingCartLineCollection
in interface ShoppingCart
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.
setByValue
in interface Belonging
setByValue
in class BelongingImpl
value
- The Belonging
to use for initialization.public void setOrderDiscountPresentations(ArrayList orderDiscountPresentations)
setOrderDiscountPresentations
in interface ShoppingCart
public void setProductItemQuantity(ProductItem item, double quantity) throws InvalidArgumentException
setProductItemQuantity
in interface ShoppingCart
InvalidArgumentException
public void setShipping(Money shipping)
setShipping
in interface ShoppingCart
shipping
- shipping to be addedpublic void setShippingDiscountPresentations(ArrayList shippingDiscountPresentations)
setShippingDiscountPresentations
in interface ShoppingCart
public void setShoppingCartLineCollection(Collection collection)
setShoppingCartLineCollection
in interface ShoppingCart
public void setSubtotal(Money subtotal)
setSubtotal
in interface ShoppingCart
subtotal
- subtotal to be addedpublic void setTotal(Money total)
setTotal
in interface ShoppingCart
total
- total to be addedpublic int shoppingCartLineCollectionHashCode()
shoppingCartLineCollectionHashCode
in interface ShoppingCart
public Iterator shoppingCartLineCollectionIterator()
shoppingCartLineCollectionIterator
in interface ShoppingCart
public int shoppingCartLineCollectionSize()
shoppingCartLineCollectionSize
in interface ShoppingCart
public Belonging value()
value
in interface Belonging
|
© 2005 BEA Systems, Inc. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |