Top Description Fields Constructors Methods
org.eclipse.persistence.internal.queries

public Class CollectionContainerPolicy

extends InterfaceContainerPolicy
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.internal.queries.ListContainerPolicy, org.eclipse.persistence.internal.queries.SortedCollectionContainerPolicy
Imports
java.util.Collection, .Vector, org.eclipse.persistence.exceptions.QueryException, org.eclipse.persistence.internal.helper.ClassConstants, .Helper, org.eclipse.persistence.internal.sessions.AbstractSession

Purpose: A CollectionContainerPolicy is ContainerPolicy whose container class implements the Collection interface.

Responsibilities: Provide the functionality to operate on an instance of a Collection.

See Also
ContainerPolicy, MapContainerPolicy

Field Summary

Inherited from org.eclipse.persistence.internal.queries.InterfaceContainerPolicy:
cloneMethodcontainerClasscontainerClassName

Constructor Summary

AccessConstructor and Description
public
CollectionContainerPolicy()

INTERNAL: Construct a new policy.

public
CollectionContainerPolicy(Class<?> containerClass)

INTERNAL: Construct a new policy for the specified class.

public
CollectionContainerPolicy(String containerClassName)

INTERNAL: Construct a new policy for the specified class name.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

boolean indicating whether the container changed.
addInto
(Object key, Object element, Object container, AbstractSession session)

Overrides org.eclipse.persistence.internal.queries.ContainerPolicy.addInto.

Implements org.eclipse.persistence.internal.core.queries.CoreContainerPolicy.addInto.

INTERNAL: Add element into a container which implements the Collection interface.
public Object
buildContainerFromVector(Vector<E> vector, AbstractSession session)

Overrides org.eclipse.persistence.internal.queries.InterfaceContainerPolicy.buildContainerFromVector.

INTERNAL: Return a container populated with the contents of the specified Vector.
public void
clear(Object
java.lang.Object
container
)

Overrides org.eclipse.persistence.internal.queries.ContainerPolicy.clear.

Implements org.eclipse.persistence.internal.core.queries.CoreContainerPolicy.clear.

INTERNAL: Remove all the elements from container.
public Object
cloneFor(Object container)

Overrides org.eclipse.persistence.internal.queries.InterfaceContainerPolicy.cloneFor.

INTERNAL: Return a clone of the specified container.
protected boolean

Returns:

boolean true if container 'contains' element
contains
(Object
java.lang.Object
element
,
Object
java.lang.Object
container
)

Overrides org.eclipse.persistence.internal.queries.ContainerPolicy.contains.

INTERNAL: Return the true if element exists in container.
public Class<?>
public boolean
hasOrder()

Overrides org.eclipse.persistence.internal.queries.ContainerPolicy.hasOrder.

INTERNAL: Return whether the collection has order.
public boolean
public boolean
public Object

Returns:

java.util.Enumeration/java.util.Iterator
iteratorFor
(Object
java.lang.Object
container
)

Implements abstract org.eclipse.persistence.internal.queries.ContainerPolicy.iteratorFor.

Implements org.eclipse.persistence.internal.core.queries.CoreContainerPolicy.iteratorFor.

INTERNAL: Return an iterator for the given container.
protected boolean
removeFrom(Object
java.lang.Object This param represents the key that would be used by this object in a map, may be null
key
,
Object
java.lang.Object
element
,
Object
java.lang.Object
container
)

Overrides org.eclipse.persistence.internal.queries.ContainerPolicy.removeFrom.

Implements org.eclipse.persistence.internal.core.queries.CoreContainerPolicy.removeFrom.

INTERNAL: Remove element from container which implements the Collection interface.
public int

Returns:

int The size of the container.
sizeFor
(Object container)

Overrides org.eclipse.persistence.internal.queries.ContainerPolicy.sizeFor.

Implements org.eclipse.persistence.internal.core.queries.CoreContainerPolicy.sizeFor.

INTERNAL: Return the size of container.
Inherited from org.eclipse.persistence.internal.queries.InterfaceContainerPolicy:
convertClassNamesToClassescreateChangeEventcreateQueryKeyForMapKeyequalsgetCloneMethodgetCloneMethodgetContainerClassgetContainerClassNamegetDirectKeyFieldhashCodehasNextinvokeCloneMethodOnisMapKeyAttributeisValidContainerTypenextsetCloneMethodsetContainerClasssetContainerClassNametoStringInfo

Constructor Detail

CollectionContainerPolicyback to summary
public CollectionContainerPolicy()

INTERNAL: Construct a new policy.

CollectionContainerPolicyback to summary
public CollectionContainerPolicy(Class<?> containerClass)

INTERNAL: Construct a new policy for the specified class.

CollectionContainerPolicyback to summary
public CollectionContainerPolicy(String containerClassName)

INTERNAL: Construct a new policy for the specified class name.

Method Detail

addIntoback to summary
public boolean addInto(Object key, Object element, Object container, AbstractSession session)

Overrides org.eclipse.persistence.internal.queries.ContainerPolicy.addInto.

Implements org.eclipse.persistence.internal.core.queries.CoreContainerPolicy.addInto.

INTERNAL: Add element into a container which implements the Collection interface.

Returns:boolean

boolean indicating whether the container changed.

Annotations
@Override
buildContainerFromVectorback to summary
public Object buildContainerFromVector(Vector<E> vector, AbstractSession session)

Overrides org.eclipse.persistence.internal.queries.InterfaceContainerPolicy.buildContainerFromVector.

INTERNAL: Return a container populated with the contents of the specified Vector.

Annotations
@Override
clearback to summary
public void clear(Object container)

Overrides org.eclipse.persistence.internal.queries.ContainerPolicy.clear.

Implements org.eclipse.persistence.internal.core.queries.CoreContainerPolicy.clear.

INTERNAL: Remove all the elements from container.

Parameters
container:Object

java.lang.Object

Annotations
@Override
cloneForback to summary
public Object cloneFor(Object container)

Overrides org.eclipse.persistence.internal.queries.InterfaceContainerPolicy.cloneFor.

INTERNAL: Return a clone of the specified container.

Annotations
@Override
containsback to summary
protected boolean contains(Object element, Object container)

Overrides org.eclipse.persistence.internal.queries.ContainerPolicy.contains.

INTERNAL: Return the true if element exists in container.

Parameters
element:Object

java.lang.Object

container:Object

java.lang.Object

Returns:boolean

boolean true if container 'contains' element

Annotations
@Override
getInterfaceTypeback to summary
public Class<?> getInterfaceType()

Implements abstract org.eclipse.persistence.internal.queries.InterfaceContainerPolicy.getInterfaceType.

Annotations
@Override
hasOrderback to summary
public boolean hasOrder()

Overrides org.eclipse.persistence.internal.queries.ContainerPolicy.hasOrder.

INTERNAL: Return whether the collection has order. SortedSets cannot be indexed, but they are order-sensitive.

Annotations
@Override
isCollectionPolicyback to summary
public boolean isCollectionPolicy()

Overrides org.eclipse.persistence.internal.queries.ContainerPolicy.isCollectionPolicy.

Annotations
@Override
isValidContainerback to summary
public boolean isValidContainer(Object container)

Overrides org.eclipse.persistence.internal.queries.ContainerPolicy.isValidContainer.

INTERNAL: Validate the container type.

Annotations
@Override
iteratorForback to summary
public Object iteratorFor(Object container)

Implements abstract org.eclipse.persistence.internal.queries.ContainerPolicy.iteratorFor.

Implements org.eclipse.persistence.internal.core.queries.CoreContainerPolicy.iteratorFor.

INTERNAL: Return an iterator for the given container.

Parameters
container:Object

java.lang.Object

Returns:Object

java.util.Enumeration/java.util.Iterator

Annotations
@Override
removeFromback to summary
protected boolean removeFrom(Object key, Object element, Object container)

Overrides org.eclipse.persistence.internal.queries.ContainerPolicy.removeFrom.

Implements org.eclipse.persistence.internal.core.queries.CoreContainerPolicy.removeFrom.

INTERNAL: Remove element from container which implements the Collection interface.

Parameters
key:Object

java.lang.Object This param represents the key that would be used by this object in a map, may be null

element:Object

java.lang.Object

container:Object

java.lang.Object

Annotations
@Override
sizeForback to summary
public int sizeFor(Object container)

Overrides org.eclipse.persistence.internal.queries.ContainerPolicy.sizeFor.

Implements org.eclipse.persistence.internal.core.queries.CoreContainerPolicy.sizeFor.

INTERNAL: Return the size of container.

Returns:int

int The size of the container.

Annotations
@Override