public class CollectionContainerPolicy extends InterfaceContainerPolicy
Purpose: A CollectionContainerPolicy is ContainerPolicy whose container class implements the Collection interface.
Responsibilities: Provide the functionality to operate on an instance of a Collection.
ContainerPolicy
,
MapContainerPolicy
,
Serialized FormcloneMethod, containerClass, containerClassName
constructor, elementDescriptor
Constructor and Description |
---|
CollectionContainerPolicy()
INTERNAL:
Construct a new policy.
|
CollectionContainerPolicy(Class containerClass)
INTERNAL:
Construct a new policy for the specified class.
|
CollectionContainerPolicy(String containerClassName)
INTERNAL:
Construct a new policy for the specified class name.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addInto(Object key,
Object element,
Object container)
INTERNAL:
Add element into a container which implements the Collection interface.
|
Object |
buildContainerFromVector(Vector vector,
AbstractSession session)
INTERNAL:
Return a container populated with the contents of the specified Vector.
|
void |
clear(Object container)
INTERNAL:
Remove all the elements from container.
|
protected boolean |
contains(Object element,
Object container)
INTERNAL:
Return the true if element exists in container.
|
Class |
getInterfaceType() |
boolean |
hasOrder()
INTERNAL:
Return whether the collection has order.
|
boolean |
isCollectionPolicy() |
boolean |
isValidContainer(Object container)
INTERNAL:
Validate the container type.
|
Object |
iteratorFor(Object container)
INTERNAL:
Return an iterator for the given container.
|
protected boolean |
removeFrom(Object key,
Object element,
Object container)
INTERNAL:
Remove element from container which implements the Collection interface.
|
int |
sizeFor(Object container)
INTERNAL:
Return the size of container.
|
cloneFor, convertClassNamesToClasses, getCloneMethod, getCloneMethod, getContainerClass, getContainerClassName, hasNext, invokeCloneMethodOn, isValidContainerType, next, setCloneMethod, setContainerClass, setContainerClassName, toStringInfo
addInto, addInto, addIntoWithOrder, addIntoWithOrder, addIntoWithOrder, buildPolicyFor, buildPolicyFor, clone, clone, compareCollectionsForChange, compareKeys, concatenateContainers, containerInstance, containerInstance, contains, containsKey, execute, getConstructor, getElementDescriptor, hasElementDescriptor, initializeConstructor, isCursoredStreamPolicy, isCursorPolicy, isCursorStreamPolicy, isDirectMapPolicy, isEmpty, isListPolicy, isMapPolicy, isScrollableCursorPolicy, keyFrom, mergeCascadeParts, mergeChanges, next, overridesRead, prepare, prepareForExecution, recordAddToCollectionInChangeRecord, recordRemoveFromCollectionInChangeRecord, remoteExecute, removeAllElements, removeFrom, removeFrom, removeFromWithOrder, setConstructor, setElementDescriptor, setKeyName, toString, validateElementAndRehashIfRequired, vectorFor
public CollectionContainerPolicy()
public CollectionContainerPolicy(Class containerClass)
public CollectionContainerPolicy(String containerClassName)
public boolean addInto(Object key, Object element, Object container)
addInto
in class ContainerPolicy
element
- java.lang.Objectcontainer
- java.lang.Objectpublic Object buildContainerFromVector(Vector vector, AbstractSession session)
buildContainerFromVector
in class ContainerPolicy
public void clear(Object container)
clear
in class ContainerPolicy
container
- java.lang.Objectprotected boolean contains(Object element, Object container)
contains
in class ContainerPolicy
element
- java.lang.Objectcontainer
- java.lang.Objectpublic Class getInterfaceType()
getInterfaceType
in class InterfaceContainerPolicy
public boolean hasOrder()
hasOrder
in class ContainerPolicy
public boolean isValidContainer(Object container)
isValidContainer
in class ContainerPolicy
isValidContainer(Object)
,
MapContainerPolicy.isValidContainer(Object)
public boolean isCollectionPolicy()
isCollectionPolicy
in class ContainerPolicy
public Object iteratorFor(Object container)
iteratorFor
in class ContainerPolicy
container
- java.lang.ObjectContainerPolicy.hasNext(java.lang.Object)
,
ContainerPolicy.next(java.lang.Object)
protected boolean removeFrom(Object key, Object element, Object container)
removeFrom
in class ContainerPolicy
key
- java.lang.Object This param represents the key that would be used by this object in a map, may be nullelement
- java.lang.Objectcontainer
- java.lang.Objectpublic int sizeFor(Object container)
sizeFor
in class ContainerPolicy
anObject
- java.lang.ObjectCopyright © 2023. All rights reserved.