atg.commerce.order
Class CostCenterImpl

java.lang.Object
  extended by atg.commerce.order.CommerceIdentifierImpl
      extended by atg.commerce.order.CostCenterImpl
All Implemented Interfaces:
ChangedProperties, CommerceIdentifier, CommerceItemRelationshipContainer, CostCenter, OrderRelationshipContainer, ShippingGroupRelationshipContainer, java.io.Serializable, java.util.Observer
Direct Known Subclasses:
CostCenterImpl

public class CostCenterImpl
extends CommerceIdentifierImpl
implements CostCenter, ChangedProperties

This class is an implementation of a CostCenter. It represents all the information which designates a cost center.

See Also:
Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Constructor Summary
CostCenterImpl()
           
 
Method Summary
 void addChangedProperty(java.lang.String pPropertyName)
          Adds a changedProperty
 void addCommerceItemRelationship(CommerceItemRelationship pCommerceItemRelationship)
          Add the CommerceItemRelationship to the container.
 void addCommerceItemRelationship(CommerceItemRelationship pCommerceItemRelationship, int pIndex)
          Add the CommerceItemRelationship to the container at the given index.
 void addOrderRelationship(OrderRelationship pOrderRelationship)
          Add the OrderRelationship to the container.
 void addShippingGroupRelationship(ShippingGroupRelationship pShippingGroupRelationship)
          Add the ShippingGroupRelationship to the container.
 void addShippingGroupRelationship(ShippingGroupRelationship pShippingGroupRelationship, int pIndex)
          Add the ShippingGroupRelationship to the container at the given index.
 void clearChangedProperties()
          Clears the changedProperties List
 double getAmount()
          returns the amount associated with this PaymentGroup.
 java.util.Set getChangedProperties()
          Returns the changedProperties
 CommerceItemRelationship getCommerceItemRelationship(java.lang.String pCommerceItemRelationshipId)
          Returns the CommerceItemRelationship whose id is pCommerceItemRelationshipId.
 int getCommerceItemRelationshipCount()
          Returns the number of CommerceItemRelationships in the container.
 java.util.List getCommerceItemRelationships()
          Returns a List of CommerceItemRelationships
 java.lang.String getCostCenterClassType()
          Returns the CostCenterClassType
 java.lang.String getDescription()
          Returns the description
 java.lang.String getIdentifier()
          Returns the identifier
 OrderRelationship getOrderRelationship()
          Returns the OrderRelationship.
 int getOrderRelationshipCount()
          Returns the number of OrderRelationships in the container.
 java.lang.Object getPropertyValue(java.lang.String pPropertyName)
          Returns a property value, if the property is not defined in the underlying item-descriptor null is returned.
 MutableRepositoryItem getRepositoryItem()
          Returns the repositoryItem
 boolean getSaveAllProperties()
          Returns the saveAllProperties
 ShippingGroupRelationship getShippingGroupRelationship(java.lang.String pShippingGroupRelationshipId)
          Returns the ShippingGroupRelationship whose id is pShippingGroupRelationshipId.
 int getShippingGroupRelationshipCount()
          Returns the number of ShippingGroupRelationships in the container.
 java.util.List getShippingGroupRelationships()
          Returns a List of ShippingGroupRelationships
 boolean isChanged()
          Returns the isChanged flag
 void removeAllCommerceItemRelationships()
          Removes all the CommerceItemRelationships
 void removeAllShippingGroupRelationships()
          Removes all the ShippingGroupRelationships.
 CommerceItemRelationship removeCommerceItemRelationship(java.lang.String pCommerceItemRelationshipId)
          Removes a CommerceItemRelationship whose id is passed in.
 OrderRelationship removeOrderRelationship()
          Removes a OrderRelationship.
 ShippingGroupRelationship removeShippingGroupRelationship(java.lang.String pShippingGroupRelationshipId)
          Removes a ShippingGroupRelationship whose id is passed in.
 void setAmount(double pAmount)
          sets the amount associated with this PaymentGroup.
 void setChanged(boolean pChanged)
          Marks this object as changed
 void setCostCenterClassType(java.lang.String pCostCenterClassType)
          Sets the CostCenterClassType
 void setDescription(java.lang.String pDescription)
          Sets the description
 void setIdentifier(java.lang.String pIdentifier)
          Sets the identifier
 void setPropertyValue(java.lang.String pPropertyName, java.lang.Object pPropertyValue)
          Sets a property value
 void setRepositoryItem(MutableRepositoryItem pRepositoryItem)
          Sets the repositoryItem
 void setSaveAllProperties(boolean pSaveAllProperties)
          Sets the saveAllProperties
 java.lang.String toString()
          returns a string representation of this object
 void update(java.util.Observable o, java.lang.Object arg)
          This method is called whenever a property in a contained object changes and the containing object needs to be notified.
 
Methods inherited from class atg.commerce.order.CommerceIdentifierImpl
getId, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface atg.commerce.order.CommerceIdentifier
getId
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

CostCenterImpl

public CostCenterImpl()
Method Detail

getCostCenterClassType

public java.lang.String getCostCenterClassType()
Returns the CostCenterClassType

Specified by:
getCostCenterClassType in interface CostCenter

setCostCenterClassType

public void setCostCenterClassType(java.lang.String pCostCenterClassType)
Sets the CostCenterClassType

Specified by:
setCostCenterClassType in interface CostCenter

getIdentifier

public java.lang.String getIdentifier()
Returns the identifier

Specified by:
getIdentifier in interface CostCenter

setIdentifier

public void setIdentifier(java.lang.String pIdentifier)
Sets the identifier

Specified by:
setIdentifier in interface CostCenter

getDescription

public java.lang.String getDescription()
Returns the description

Specified by:
getDescription in interface CostCenter

setDescription

public void setDescription(java.lang.String pDescription)
Sets the description

Specified by:
setDescription in interface CostCenter

getAmount

public double getAmount()
returns the amount associated with this PaymentGroup.

Specified by:
getAmount in interface CostCenter

setAmount

public void setAmount(double pAmount)
sets the amount associated with this PaymentGroup.

Specified by:
setAmount in interface CostCenter
Parameters:
pAmount - the amount to set for this payment

getCommerceItemRelationships

public java.util.List getCommerceItemRelationships()
Returns a List of CommerceItemRelationships

Specified by:
getCommerceItemRelationships in interface CommerceItemRelationshipContainer

addCommerceItemRelationship

public void addCommerceItemRelationship(CommerceItemRelationship pCommerceItemRelationship)
                                 throws DuplicateRelationshipException,
                                        InvalidParameterException
Add the CommerceItemRelationship to the container. If the CommerceItemRelationship was already in the container a DuplicateRelationshipException is thrown.

Specified by:
addCommerceItemRelationship in interface CommerceItemRelationshipContainer
Throws:
DuplicateRelationshipException
InvalidParameterException

addCommerceItemRelationship

public void addCommerceItemRelationship(CommerceItemRelationship pCommerceItemRelationship,
                                        int pIndex)
                                 throws DuplicateRelationshipException,
                                        InvalidParameterException
Add the CommerceItemRelationship to the container at the given index. If the CommerceItemRelationship was already in the container a DuplicateRelationshipException is thrown.

Specified by:
addCommerceItemRelationship in interface CommerceItemRelationshipContainer
Throws:
DuplicateRelationshipException
InvalidParameterException

removeCommerceItemRelationship

public CommerceItemRelationship removeCommerceItemRelationship(java.lang.String pCommerceItemRelationshipId)
                                                        throws RelationshipNotFoundException,
                                                               InvalidParameterException
Removes a CommerceItemRelationship whose id is passed in. If the CommerceItemRelationship is not in the container then a RelationshipNotFoundException is thrown. Otherwise a reference to the removed CommerceItemRelationship is returned.

Specified by:
removeCommerceItemRelationship in interface CommerceItemRelationshipContainer
Throws:
RelationshipNotFoundException
InvalidParameterException

removeAllCommerceItemRelationships

public void removeAllCommerceItemRelationships()
Removes all the CommerceItemRelationships

Specified by:
removeAllCommerceItemRelationships in interface CommerceItemRelationshipContainer

getCommerceItemRelationship

public CommerceItemRelationship getCommerceItemRelationship(java.lang.String pCommerceItemRelationshipId)
                                                     throws RelationshipNotFoundException,
                                                            InvalidParameterException
Returns the CommerceItemRelationship whose id is pCommerceItemRelationshipId. If theCommerceItemRelationship with the corresponding id is not in the container then a RelationshipNotFoundException is thrown.

Specified by:
getCommerceItemRelationship in interface CommerceItemRelationshipContainer
Throws:
RelationshipNotFoundException
InvalidParameterException

getCommerceItemRelationshipCount

public int getCommerceItemRelationshipCount()
Returns the number of CommerceItemRelationships in the container.

Specified by:
getCommerceItemRelationshipCount in interface CommerceItemRelationshipContainer

getShippingGroupRelationships

public java.util.List getShippingGroupRelationships()
Returns a List of ShippingGroupRelationships

Specified by:
getShippingGroupRelationships in interface ShippingGroupRelationshipContainer

addShippingGroupRelationship

public void addShippingGroupRelationship(ShippingGroupRelationship pShippingGroupRelationship)
                                  throws DuplicateRelationshipException,
                                         InvalidParameterException
Add the ShippingGroupRelationship to the container. If the ShippingGroupRelationship was already in the container a DuplicateRelationshipException is thrown.

Specified by:
addShippingGroupRelationship in interface ShippingGroupRelationshipContainer
Throws:
DuplicateRelationshipException
InvalidParameterException

addShippingGroupRelationship

public void addShippingGroupRelationship(ShippingGroupRelationship pShippingGroupRelationship,
                                         int pIndex)
                                  throws DuplicateRelationshipException,
                                         InvalidParameterException
Add the ShippingGroupRelationship to the container at the given index. If the ShippingGroupRelationship was already in the container a DuplicateRelationshipException is thrown.

Specified by:
addShippingGroupRelationship in interface ShippingGroupRelationshipContainer
Throws:
DuplicateRelationshipException
InvalidParameterException

removeShippingGroupRelationship

public ShippingGroupRelationship removeShippingGroupRelationship(java.lang.String pShippingGroupRelationshipId)
                                                          throws RelationshipNotFoundException,
                                                                 InvalidParameterException
Removes a ShippingGroupRelationship whose id is passed in. If the ShippingGroupRelationship is not in the container then a RelationshipNotFoundException is thrown. Otherwise a reference to the removed ShippingGroupRelationship is returned.

Specified by:
removeShippingGroupRelationship in interface ShippingGroupRelationshipContainer
Throws:
RelationshipNotFoundException
InvalidParameterException

removeAllShippingGroupRelationships

public void removeAllShippingGroupRelationships()
Removes all the ShippingGroupRelationships.

Specified by:
removeAllShippingGroupRelationships in interface ShippingGroupRelationshipContainer

getShippingGroupRelationship

public ShippingGroupRelationship getShippingGroupRelationship(java.lang.String pShippingGroupRelationshipId)
                                                       throws RelationshipNotFoundException,
                                                              InvalidParameterException
Returns the ShippingGroupRelationship whose id is pShippingGroupRelationshipId. If theShippingGroupRelationship with the corresponding id is not in the container then a RelationshipNotFoundException is thrown.

Specified by:
getShippingGroupRelationship in interface ShippingGroupRelationshipContainer
Throws:
RelationshipNotFoundException
InvalidParameterException

getShippingGroupRelationshipCount

public int getShippingGroupRelationshipCount()
Returns the number of ShippingGroupRelationships in the container.

Specified by:
getShippingGroupRelationshipCount in interface ShippingGroupRelationshipContainer

addOrderRelationship

public void addOrderRelationship(OrderRelationship pOrderRelationship)
                          throws DuplicateRelationshipException,
                                 InvalidParameterException
Add the OrderRelationship to the container. If the OrderRelationship was already in the container a DuplicateRelationshipException is thrown.

Specified by:
addOrderRelationship in interface OrderRelationshipContainer
Throws:
DuplicateRelationshipException
InvalidParameterException

removeOrderRelationship

public OrderRelationship removeOrderRelationship()
                                          throws RelationshipNotFoundException,
                                                 InvalidParameterException
Removes a OrderRelationship. If the OrderRelationship is not in the container then a RelationshipNotFoundException is thrown. Otherwise a reference to the removed OrderRelationship is returned.

Specified by:
removeOrderRelationship in interface OrderRelationshipContainer
Throws:
RelationshipNotFoundException
InvalidParameterException

getOrderRelationship

public OrderRelationship getOrderRelationship()
                                       throws RelationshipNotFoundException,
                                              InvalidParameterException
Returns the OrderRelationship. If theOrderRelationship is not in the container then a RelationshipNotFoundException is thrown.

Specified by:
getOrderRelationship in interface OrderRelationshipContainer
Throws:
RelationshipNotFoundException
InvalidParameterException

getOrderRelationshipCount

public int getOrderRelationshipCount()
Returns the number of OrderRelationships in the container. The returned value will be either 0 or 1.

Specified by:
getOrderRelationshipCount in interface OrderRelationshipContainer

update

public void update(java.util.Observable o,
                   java.lang.Object arg)
This method is called whenever a property in a contained object changes and the containing object needs to be notified.

Specified by:
update in interface java.util.Observer
Parameters:
o - the object which changed
arg - the name of the property which changed

getSaveAllProperties

public boolean getSaveAllProperties()
Returns the saveAllProperties

Specified by:
getSaveAllProperties in interface ChangedProperties

setSaveAllProperties

public void setSaveAllProperties(boolean pSaveAllProperties)
Sets the saveAllProperties

Specified by:
setSaveAllProperties in interface ChangedProperties

isChanged

public boolean isChanged()
Returns the isChanged flag

Specified by:
isChanged in interface ChangedProperties

setChanged

public void setChanged(boolean pChanged)
Marks this object as changed

Specified by:
setChanged in interface ChangedProperties

getChangedProperties

public java.util.Set getChangedProperties()
Returns the changedProperties

Specified by:
getChangedProperties in interface ChangedProperties

addChangedProperty

public void addChangedProperty(java.lang.String pPropertyName)
Adds a changedProperty

Specified by:
addChangedProperty in interface ChangedProperties

clearChangedProperties

public void clearChangedProperties()
Clears the changedProperties List

Specified by:
clearChangedProperties in interface ChangedProperties

getRepositoryItem

public MutableRepositoryItem getRepositoryItem()
Returns the repositoryItem

Specified by:
getRepositoryItem in interface ChangedProperties

setRepositoryItem

public void setRepositoryItem(MutableRepositoryItem pRepositoryItem)
Sets the repositoryItem

Specified by:
setRepositoryItem in interface ChangedProperties

getPropertyValue

public java.lang.Object getPropertyValue(java.lang.String pPropertyName)
Returns a property value, if the property is not defined in the underlying item-descriptor null is returned.

Specified by:
getPropertyValue in interface ChangedProperties
Returns:
returns a property value

setPropertyValue

public void setPropertyValue(java.lang.String pPropertyName,
                             java.lang.Object pPropertyValue)
Sets a property value

Specified by:
setPropertyValue in interface ChangedProperties
Parameters:
pPropertyValue - the value to set for the given property value

toString

public java.lang.String toString()
returns a string representation of this object

Overrides:
toString in class java.lang.Object