Class PersistenceElementCollection
java.lang.Object
com.sun.jdo.api.persistence.model.jdo.impl.PersistenceElementCollection
- Version:
- %I%
- Author:
- raccah
-
Constructor Summary
ConstructorsConstructorDescriptionCreate new PersistenceElementCollection with no owner, property, or template.PersistenceElementCollection(PersistenceElementImpl owner, String propertyName, Object[] template) Creates new PersistenceElementCollection -
Method Summary
Modifier and TypeMethodDescriptionvoidchangeElements(PersistenceElement[] elements, int action) Change the set of elements.voidchangeElements(List elements, int action) Change the set of elements.getElement(String name) Returns the element with the supplied name from the collection of elements maintained by this collection.Returns the collection of elements maintained by this holder in the form of an array.getOwner()Returns the owner of this collection.Returns the property name of this collection.Object[]Returns the template for the array of this collection.voidsetElements(PersistenceElement[] elements) Set the collection of elements maintained by this holder to the supplied array.voidsetOwner(PersistenceElementImpl owner) Set the owner of this collection to the supplied implementation.voidsetPropertyName(String propertyName) Set the property name of this collection to the supplied name.voidsetTemplate(Object[] template) Set the template for the array of this collection to the supplied array.
-
Constructor Details
-
PersistenceElementCollection
public PersistenceElementCollection()Create new PersistenceElementCollection with no owner, property, or template. This constructor should only be used for cloning and archiving. -
PersistenceElementCollection
public PersistenceElementCollection(PersistenceElementImpl owner, String propertyName, Object[] template) Creates new PersistenceElementCollection
-
-
Method Details
-
changeElements
Change the set of elements.- Parameters:
elements- the new elementsaction-PersistenceElement.Impl.ADD,PersistenceElement.Impl.REMOVE, orPersistenceElement.Impl.SET- Throws:
ModelException- if impossible
-
changeElements
Change the set of elements.- Parameters:
elements- the new elementsaction-PersistenceElement.Impl.ADD,PersistenceElement.Impl.REMOVE, orPersistenceElement.Impl.SET- Throws:
ModelException- if impossible
-
getElements
Returns the collection of elements maintained by this holder in the form of an array.- Returns:
- the elements maintained by this collection
-
getElement
Returns the element with the supplied name from the collection of elements maintained by this collection.- Parameters:
name- the name to match- Returns:
- the element with the supplied name,
nullif none exists
-
getOwner
Returns the owner of this collection. This method should only be used internally and for cloning and archiving.- Returns:
- the owner of this collection
-
setOwner
Set the owner of this collection to the supplied implementation. This method should only be used internally and for cloning and archiving.- Parameters:
owner- the owner of this collection
-
getTemplate
Returns the template for the array of this collection. This method should only be used internally and for cloning and archiving.- Returns:
- the typed template of this collection
-
setTemplate
Set the template for the array of this collection to the supplied array. This template is used so the array returned by getElements is properly typed. This method should only be used internally and for cloning and archiving.- Parameters:
template- the typed template of this collection
-
getPropertyName
Returns the property name of this collection. This method should only be used internally and for cloning and archiving.- Returns:
- the property name for this collection
-
setPropertyName
Set the property name of this collection to the supplied name. This name is used to generate the correct property change event on changes to the collection. This method should only be used internally and for cloning and archiving.- Parameters:
propertyName- the property name for this collection
-
setElements
Set the collection of elements maintained by this holder to the supplied array. This method should only be used internally and for cloning and archiving.- Parameters:
elements- the collection of elements maintained by this holder
-