atg.commerce.order
Class RelationshipContainerImpl

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

public class RelationshipContainerImpl
extends java.lang.Object
implements RelationshipContainer

A class which manages the containment of Relationship objects.

See Also:
Serialized Form

Field Summary
static java.lang.String CLASS_VERSION
          Class version string
protected static java.lang.String RELATIONSHIPS
           
 
Constructor Summary
RelationshipContainerImpl(MutableRepositoryItem pRepositoryItem)
          Constructs a RelationshipContainerImpl object.
 
Method Summary
 void addRelationship(Relationship pRelationship)
          Add the Relationship to the container.
 void addRelationship(Relationship pRelationship, int pIndex)
          Add the Relationship to the container at the given index.
 Relationship getRelationship(java.lang.String pRelationshipId)
          Returns the Relationship whose id is pRelationshipId.
 int getRelationshipCount()
          Returns the number of Relationships in the container.
 java.util.List getRelationships()
          Returns a List of Relationships.
protected  java.util.List getRepositoryItemList()
           
 void removeAllRelationships()
          Removes all the Relationships
 Relationship removeRelationship(java.lang.String pRelationshipId)
          Removes a Relationship 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


RELATIONSHIPS

protected static java.lang.String RELATIONSHIPS
Constructor Detail

RelationshipContainerImpl

public RelationshipContainerImpl(MutableRepositoryItem pRepositoryItem)
Constructs a RelationshipContainerImpl object.

Method Detail

getRepositoryItemList

protected java.util.List getRepositoryItemList()

getRelationships

public java.util.List getRelationships()
Returns a List of Relationships. 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:
getRelationships in interface RelationshipContainer

addRelationship

public void addRelationship(Relationship pRelationship)
                     throws DuplicateRelationshipException,
                            InvalidParameterException
Add the Relationship to the container. If the Relationship was already in the container a DuplicateRelationshipException is thrown.

Specified by:
addRelationship in interface RelationshipContainer
Throws:
DuplicateRelationshipException
InvalidParameterException

addRelationship

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

Specified by:
addRelationship in interface RelationshipContainer
Throws:
DuplicateRelationshipException
InvalidParameterException

removeRelationship

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

Specified by:
removeRelationship in interface RelationshipContainer
Throws:
RelationshipNotFoundException
InvalidParameterException

removeAllRelationships

public void removeAllRelationships()
Removes all the Relationships

Specified by:
removeAllRelationships in interface RelationshipContainer

getRelationship

public Relationship getRelationship(java.lang.String pRelationshipId)
                             throws RelationshipNotFoundException,
                                    InvalidParameterException
Returns the Relationship whose id is pRelationshipId. If the Relationship with the corresponding id is not in the container then a RelationshipNotFoundException is thrown.

Specified by:
getRelationship in interface RelationshipContainer
Throws:
RelationshipNotFoundException
InvalidParameterException

getRelationshipCount

public int getRelationshipCount()
Returns the number of Relationships in the container.

Specified by:
getRelationshipCount in interface RelationshipContainer