atg.b2bcommerce.order
Class CostCenterContainerImpl

java.lang.Object
  extended by atg.b2bcommerce.order.CostCenterContainerImpl
All Implemented Interfaces:
CostCenterContainer, java.io.Serializable

public class CostCenterContainerImpl
extends java.lang.Object
implements CostCenterContainer

A class which manages the containment of CostCenter objects.

See Also:
Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected static java.lang.String COST_CENTERS
           
 
Constructor Summary
CostCenterContainerImpl(MutableRepositoryItem pRepositoryItem)
          Constructs a CostCenterContainerImpl object.
 
Method Summary
 void addCostCenter(CostCenter pCostCenter)
          Add the CostCenter to the container.
 void addCostCenter(CostCenter pCostCenter, int pIndex)
          Add the CostCenter to the container at the given index.
 CostCenter getCostCenter(java.lang.String pCostCenterId)
          Returns the CostCenter whose id is pCostCenterId.
 int getCostCenterCount()
          Returns the number of CostCenters in the container.
 java.util.List getCostCenters()
          Returns a List of CostCenters.
protected  java.util.List getRepositoryItemList()
           
 void removeAllCostCenters()
          Removes all the CostCenters
 CostCenter removeCostCenter(java.lang.String pCostCenterId)
          Removes a CostCenter whose id is passed in.
 
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


COST_CENTERS

protected static java.lang.String COST_CENTERS
Constructor Detail

CostCenterContainerImpl

public CostCenterContainerImpl(MutableRepositoryItem pRepositoryItem)
Constructs a CostCenterContainerImpl object.

Method Detail

getRepositoryItemList

protected java.util.List getRepositoryItemList()

getCostCenters

public java.util.List getCostCenters()
Returns a List of CostCenters. 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:
getCostCenters in interface CostCenterContainer

addCostCenter

public void addCostCenter(CostCenter pCostCenter)
                   throws DuplicateCostCenterException,
                          InvalidParameterException
Add the CostCenter to the container. If the CostCenter was already in the container a DuplicateCostCenterException is thrown.

Specified by:
addCostCenter in interface CostCenterContainer
Throws:
DuplicateCostCenterException
InvalidParameterException

addCostCenter

public void addCostCenter(CostCenter pCostCenter,
                          int pIndex)
                   throws DuplicateCostCenterException,
                          InvalidParameterException
Add the CostCenter to the container at the given index. If the CostCenter was already in the container a DuplicateCostCenterException is thrown.

Specified by:
addCostCenter in interface CostCenterContainer
Throws:
DuplicateCostCenterException
InvalidParameterException

removeCostCenter

public CostCenter removeCostCenter(java.lang.String pCostCenterId)
                            throws CostCenterNotFoundException,
                                   InvalidParameterException
Removes a CostCenter whose id is passed in. If the CostCenter is not in the container then a CostCenterNotFoundException is thrown. Otherwise a reference to the removed CostCenter is returned.

Specified by:
removeCostCenter in interface CostCenterContainer
Throws:
CostCenterNotFoundException
InvalidParameterException

removeAllCostCenters

public void removeAllCostCenters()
Removes all the CostCenters

Specified by:
removeAllCostCenters in interface CostCenterContainer

getCostCenter

public CostCenter getCostCenter(java.lang.String pCostCenterId)
                         throws CostCenterNotFoundException,
                                InvalidParameterException
Returns the CostCenter whose id is pCostCenterId. If the CostCenter with the corresponding id is not in the container then a CostCenterNotFoundException is thrown.

Specified by:
getCostCenter in interface CostCenterContainer
Throws:
CostCenterNotFoundException
InvalidParameterException

getCostCenterCount

public int getCostCenterCount()
Returns the number of CostCenters in the container.

Specified by:
getCostCenterCount in interface CostCenterContainer