atg.commerce.order
Class CommerceItemContainerImpl

java.lang.Object
  extended by atg.commerce.order.CommerceItemContainerImpl
All Implemented Interfaces:
CommerceItemContainer, java.io.Serializable

public class CommerceItemContainerImpl
extends java.lang.Object
implements CommerceItemContainer

A class which manages the containment of CommerceItem objects.

See Also:
Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected static java.lang.String COMMERCE_ITEMS
           
 
Constructor Summary
CommerceItemContainerImpl()
          Constructs a CommerceItemContainerImpl object.
CommerceItemContainerImpl(MutableRepositoryItem pRepositoryItem)
          Constructs a CommerceItemContainerImpl object.
 
Method Summary
 void addCommerceItem(CommerceItem pCommerceItem)
          Add the CommerceItem to the container.
 void addCommerceItem(CommerceItem pCommerceItem, int pIndex)
          Add the CommerceItem to the container at the given index.
 CommerceItem getCommerceItem(java.lang.String pCommerceItemId)
          Returns the CommerceItem whose id is pCommerceItemId.
 int getCommerceItemCount()
          Returns the number of CommerceItems in the container.
 java.util.List getCommerceItems()
          Returns a List of CommerceItems.
 java.util.List getCommerceItemsByCatalogRefId(java.lang.String pCatalogRefId)
          Returns a List of CommerceItems whose catalogRefId is pCatalogRefId.
protected  java.util.List getRepositoryItemList()
           
 long getTotalCommerceItemCount()
          Returns the number of individual CommerceItems in the container.
 void removeAllCommerceItems()
          Removes all the CommerceItems
 CommerceItem removeCommerceItem(java.lang.String pCommerceItemId)
          Removes a CommerceItem whose id is passed as a parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string


COMMERCE_ITEMS

protected static java.lang.String COMMERCE_ITEMS
Constructor Detail

CommerceItemContainerImpl

public CommerceItemContainerImpl()
Constructs a CommerceItemContainerImpl object.


CommerceItemContainerImpl

public CommerceItemContainerImpl(MutableRepositoryItem pRepositoryItem)
Constructs a CommerceItemContainerImpl object.

Method Detail

getRepositoryItemList

protected java.util.List getRepositoryItemList()

getCommerceItems

public java.util.List getCommerceItems()
Returns a List of CommerceItems. Note that the returned List should not be edited directly. Doing so will result in unexpected behavior. Any editing should be done through this class.

Specified by:
getCommerceItems in interface CommerceItemContainer

addCommerceItem

public void addCommerceItem(CommerceItem pCommerceItem)
                     throws DuplicateCommerceItemException,
                            InvalidParameterException
Add the CommerceItem to the container. If the CommerceItem was already in the container a DuplicateCommerceItemException is thrown.

Specified by:
addCommerceItem in interface CommerceItemContainer
Throws:
DuplicateCommerceItemException
InvalidParameterException

addCommerceItem

public void addCommerceItem(CommerceItem pCommerceItem,
                            int pIndex)
                     throws DuplicateCommerceItemException,
                            InvalidParameterException
Add the CommerceItem to the container at the given index. If the CommerceItem was already in the container a DuplicateCommerceItemException is thrown.

Specified by:
addCommerceItem in interface CommerceItemContainer
Throws:
DuplicateCommerceItemException
InvalidParameterException

removeCommerceItem

public CommerceItem removeCommerceItem(java.lang.String pCommerceItemId)
                                throws CommerceItemNotFoundException,
                                       InvalidParameterException
Removes a CommerceItem whose id is passed as a parameter. If the CommerceItem is not in the container then a CommerceItemNotFoundException is thrown. Otherwise a reference to the removed CommerceItem is returned.

Specified by:
removeCommerceItem in interface CommerceItemContainer
Throws:
CommerceItemNotFoundException
InvalidParameterException

removeAllCommerceItems

public void removeAllCommerceItems()
Removes all the CommerceItems

Specified by:
removeAllCommerceItems in interface CommerceItemContainer

getCommerceItem

public CommerceItem getCommerceItem(java.lang.String pCommerceItemId)
                             throws CommerceItemNotFoundException,
                                    InvalidParameterException
Returns the CommerceItem whose id is pCommerceItemId. If the CommerceItem with the corresponding id is not in the container then an CommerceItemNotFoundException is thrown.

Specified by:
getCommerceItem in interface CommerceItemContainer
Throws:
CommerceItemNotFoundException
InvalidParameterException

getCommerceItemsByCatalogRefId

public java.util.List getCommerceItemsByCatalogRefId(java.lang.String pCatalogRefId)
                                              throws CommerceItemNotFoundException,
                                                     InvalidParameterException
Returns a List of CommerceItems whose catalogRefId is pCatalogRefId. If a CommerceItem with the corresponding catalogRefId is not in the container then a CommerceItemNotFoundException is thrown.

Specified by:
getCommerceItemsByCatalogRefId in interface CommerceItemContainer
Throws:
CommerceItemNotFoundException
InvalidParameterException

getCommerceItemCount

public int getCommerceItemCount()
Returns the number of CommerceItems in the container.

Specified by:
getCommerceItemCount in interface CommerceItemContainer

getTotalCommerceItemCount

public long getTotalCommerceItemCount()
Returns the number of individual CommerceItems in the container. This means the total of all the quantities in each CommerceItem.

Specified by:
getTotalCommerceItemCount in interface CommerceItemContainer