FileDocCategorySizeDatePackage
ContainerPolicy.javaAPI DocGlassfish v2 API36132Tue May 22 16:54:40 BST 2007oracle.toplink.essentials.internal.queryframework

ContainerPolicy

public abstract class ContainerPolicy extends Object implements Serializable, Cloneable

Purpose: Used to support collections in read queries.

Responsibilities: Map the results into the appropriate collection instance. Generically support special collections like cursored stream and virtual collection.

author
James Sutherland
since
TOPLink/Java 1.2

Fields Summary
protected transient oracle.toplink.essentials.descriptors.ClassDescriptor
elementDescriptor
The descriptor is used to wrap and unwrap objects using the wrapper policy.
protected transient Constructor
constructor
Constructors Summary
public ContainerPolicy()
Default constructor.

    
Methods Summary
protected booleanaddInto(java.lang.Object key, java.lang.Object element, java.lang.Object container)
INTERNAL: Add element to container however that needs to be done for the type of container. Valid for some subclasses only. Return whether the container changed.

        throw QueryException.cannotAddToContainer(element, container, this);
    
public booleanaddInto(java.lang.Object element, java.lang.Object container, oracle.toplink.essentials.internal.sessions.AbstractSession session)
INTERNAL: Add element to container. This is used to add to a collection independent of JDK 1.1 and 1.2. The session may be required to wrap for the wrapper policy. Return whether the container changed

        return addInto(null, element, container, session);
    
public booleanaddInto(java.lang.Object key, java.lang.Object element, java.lang.Object container, oracle.toplink.essentials.internal.sessions.AbstractSession session)
INTERNAL: Add element to container. This is used to add to a collection independent of JDK 1.1 and 1.2. The session may be required to wrap for the wrapper policy. Return whether the container changed

        Object elementToAdd = element;
        if (hasElementDescriptor()) {
            elementToAdd = getElementDescriptor().getObjectBuilder().wrapObject(element, session);
        }
        return addInto(key, elementToAdd, container);
    
public voidaddIntoWithOrder(java.lang.Integer index, java.lang.Object element, java.lang.Object container)
INTERNAL: It is illegal to send this message to this receiver. Try one of my subclasses. Throws an exception.

see
#ListContainerPolicy

        throw QueryException.methodDoesNotExistInContainerClass("set", getContainerClass());
    
public voidaddIntoWithOrder(java.lang.Integer index, java.lang.Object element, java.lang.Object container, oracle.toplink.essentials.internal.sessions.AbstractSession session)
INTERNAL: It is illegal to send this message to this receiver. Try one of my subclasses. Throws an exception.

see
#ListContainerPolicy

        Object elementToAdd = element;
        if (hasElementDescriptor()) {
            elementToAdd = getElementDescriptor().getObjectBuilder().wrapObject(element, session);
        }
        addIntoWithOrder(index, elementToAdd, container);
    
public voidaddIntoWithOrder(java.util.Vector indexes, java.util.Hashtable elements, java.lang.Object container, oracle.toplink.essentials.internal.sessions.AbstractSession session)
INTERNAL: It is illegal to send this message to this receiver. Try one of my subclasses. Throws an exception.

see
#ListContainerPolicy

        throw QueryException.methodDoesNotExistInContainerClass("set", getContainerClass());
    
public java.lang.ObjectbuildContainerFromVector(java.util.Vector vector, oracle.toplink.essentials.internal.sessions.AbstractSession session)
INTERNAL: Return a container populated with the contents of the specified Vector.

        Object container = containerInstance(vector.size());

        for (Enumeration e = vector.elements(); e.hasMoreElements();) {
            addInto(e.nextElement(), container, session);
        }
        return container;
    
public static oracle.toplink.essentials.internal.queryframework.ContainerPolicybuildPolicyFor(java.lang.Class concreteContainerClass, boolean hasOrdering)
INTERNAL: Return the appropriate container policy for the specified concrete container class.

        if (Helper.classImplementsInterface(concreteContainerClass, ClassConstants.List_Class)) {
            if (hasOrdering) {
                return new OrderedListContainerPolicy(concreteContainerClass);
            } else {
                return new ListContainerPolicy(concreteContainerClass);
            }
        } else if (Helper.classImplementsInterface(concreteContainerClass, ClassConstants.SortedSet_Class)) {
            return new SortedCollectionContainerPolicy(concreteContainerClass);
        } else if (Helper.classImplementsInterface(concreteContainerClass, ClassConstants.Collection_Class)) {
            return new CollectionContainerPolicy(concreteContainerClass);
        } else if (Helper.classImplementsInterface(concreteContainerClass, ClassConstants.Map_Class)) {
            return new MapContainerPolicy(concreteContainerClass);
        }

        throw ValidationException.illegalContainerClass(concreteContainerClass);
    
public static oracle.toplink.essentials.internal.queryframework.ContainerPolicybuildPolicyFor(java.lang.Class concreteContainerClass)
INTERNAL: Return the appropriate container policy for the specified concrete container class.

        return buildPolicyFor(concreteContainerClass, false);
    
public voidclear(java.lang.Object container)
INTERNAL: Remove all the elements from the specified container. Valid only for certain subclasses.

        throw QueryException.methodNotValid(this, "clear(Object container)");
    
public java.lang.Objectclone()

        try {
            return super.clone();
        } catch (CloneNotSupportedException e) {
            throw new InternalError();
        }
    
public oracle.toplink.essentials.internal.queryframework.ContainerPolicyclone(ReadQuery query)

        return (ContainerPolicy)clone();
    
public java.lang.ObjectcloneFor(java.lang.Object container)
INTERNAL: Return a clone of the specified container. Can only be called for select subclasses.

        throw QueryException.cannotCreateClone(this, container);
    
public voidcompareCollectionsForChange(java.lang.Object oldCollection, java.lang.Object newCollection, oracle.toplink.essentials.internal.sessions.CollectionChangeRecord changeRecord, oracle.toplink.essentials.internal.sessions.AbstractSession session, oracle.toplink.essentials.descriptors.ClassDescriptor referenceDescriptor)
INTERNAL: This method is used to calculate the differences between two collections.

        // 2612538 - the default size of IdentityHashtable (32) is appropriate
        IdentityHashMap originalKeyValues = new IdentityHashMap();
        IdentityHashMap cloneKeyValues = new IdentityHashMap();

        // Collect the values from the oldCollection.
        if (oldCollection != null) {
            Object backUpIter = iteratorFor(oldCollection);
            
            while (hasNext(backUpIter)) {
                Object secondObject = next(backUpIter, session);
    
                // CR2378 null check to prevent a null pointer exception - XC
                if (secondObject != null) {
                    originalKeyValues.put(secondObject, secondObject);
                }
            }
        }
        
        if (newCollection != null){
            // Collect the objects from the new Collection.
            Object cloneIter = iteratorFor(newCollection);
            
            while (hasNext(cloneIter)) {
                Object firstObject = next(cloneIter, session);
    
                // CR2378 null check to prevent a null pointer exception - XC
                // If value is null then nothing can be done with it.
                if (firstObject != null) {
                    if (originalKeyValues.containsKey(firstObject)) {
                        // There is an original in the cache
                        if ((compareKeys(firstObject, session))) {
                            // The keys have not changed
                            originalKeyValues.remove(firstObject);
                        } else {
                            // The keys have changed, create a changeSet 
                            // (it will be resused later) and set the old key 
                            // value to be used to remove.
                            Object backUpVersion = null;
    
                            // CR4172 compare the keys from the back up to the 
                            // clone not from the original to the clone.
                            if (((UnitOfWorkImpl)session).isClassReadOnly(firstObject.getClass())) {
                                backUpVersion = ((UnitOfWorkImpl)session).getOriginalVersionOfObject(firstObject);
                            } else {
                                backUpVersion = ((UnitOfWorkImpl)session).getBackupClone(firstObject);
                            }
                            
                            ObjectChangeSet changeSet = referenceDescriptor.getObjectBuilder().createObjectChangeSet(firstObject, (UnitOfWorkChangeSet) changeRecord.getOwner().getUOWChangeSet(), session);
                            changeSet.setOldKey(keyFrom(backUpVersion, session));
                            changeSet.setNewKey(keyFrom(firstObject, session));
                            cloneKeyValues.put(firstObject, firstObject);
                        }
                    } else {
                        // Place it in the add collection
                        cloneKeyValues.put(firstObject, firstObject);
                    }
                }
            }
        }

        changeRecord.addAdditionChange(cloneKeyValues, (UnitOfWorkChangeSet) changeRecord.getOwner().getUOWChangeSet(), session);
        changeRecord.addRemoveChange(originalKeyValues, (UnitOfWorkChangeSet) changeRecord.getOwner().getUOWChangeSet(), session);
    
public booleancompareKeys(java.lang.Object sourceKey, oracle.toplink.essentials.internal.sessions.AbstractSession session)
INTERNAL: Return true if keys are the same in the source as the backup. False otherwise in the case of readonly compare against the original For non map container policies return true always, because these policies have no concepts of Keys

        return true;
    
public java.lang.ObjectconcatenateContainers(java.lang.Object firstContainer, java.lang.Object secondContainer)
INTERNAL: Build a new container, add the contents of each of the specified containers to it, and return it. Both of the containers must use the same container policy (namely, this one).

        Object container = containerInstance(sizeFor(firstContainer) + sizeFor(secondContainer));

        for (Object firstIter = iteratorFor(firstContainer); hasNext(firstIter);) {
            addInto(null, next(firstIter), container);
        }

        for (Object secondIter = iteratorFor(secondContainer); hasNext(secondIter);) {
            addInto(null, next(secondIter), container);
        }
        return container;
    
public java.lang.ObjectcontainerInstance()
INTERNAL: Return an instance of the container class. Null should never be returned. A ValidationException is thrown on error.

        try {
            if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){
                try {
                    return AccessController.doPrivileged(new PrivilegedNewInstanceFromClass(getContainerClass()));
                } catch (PrivilegedActionException exception) {
                    throw QueryException.couldNotInstantiateContainerClass(getContainerClass(), exception.getException());
                }
            } else {
                return PrivilegedAccessHelper.newInstanceFromClass(getContainerClass());
            }
        } catch (Exception ex) {
            throw QueryException.couldNotInstantiateContainerClass(getContainerClass(), ex);
        }
    
public java.lang.ObjectcontainerInstance(int initialCapacity)
INTERNAL: Return an instance of the container class with the specified initial capacity. Null should never be returned. A ValidationException is thrown on error.

        if (getConstructor() == null) {
            return containerInstance();
        }
        try {
            Object[] arguments = new Object[1];

            //Code change for 3732.  No longer need to add 1 as this was for JDK 1.1
            arguments[0] = new Integer(initialCapacity);
            if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){
                try {
                    return AccessController.doPrivileged(new PrivilegedInvokeConstructor(getConstructor(), arguments));
                } catch (PrivilegedActionException exception) {
                    throw QueryException.couldNotInstantiateContainerClass(getContainerClass(), exception.getException());
                }
            } else {
                return PrivilegedAccessHelper.invokeConstructor(getConstructor(), arguments);
            }
        } catch (Exception ex) {
            throw QueryException.couldNotInstantiateContainerClass(getContainerClass(), ex);
        }
    
protected booleancontains(java.lang.Object element, java.lang.Object container)
INTERNAL: Return whether element exists in container.

        throw QueryException.methodNotValid(this, "contains(Object element, Object container)");
    
public booleancontains(java.lang.Object element, java.lang.Object container, oracle.toplink.essentials.internal.sessions.AbstractSession session)
INTERNAL: Check if the object is contained in the collection. This is used to check contains in a collection independent of JDK 1.1 and 1.2. The session may be required to unwrap for the wrapper policy.

        if (hasElementDescriptor() && getElementDescriptor().hasWrapperPolicy()) {
            // The wrapper for the object must be removed.
            Object iterator = iteratorFor(container);
            while (hasNext(iterator)) {
                Object next = next(iterator);
                if (getElementDescriptor().getObjectBuilder().unwrapObject(next, session).equals(element)) {
                    return true;
                }
            }
            return false;
        } else {
            return contains(element, container);
        }
    
protected booleancontainsKey(java.lang.Object element, java.lang.Object container)
INTERNAL: Return whether element exists in container.

        throw QueryException.methodNotValid(this, "containsKey(Object element, Object container)");
    
public voidconvertClassNamesToClasses(java.lang.ClassLoader classLoader)
INTERNAL: Convert all the class-name-based settings in this ContainerPolicy to actual class-based settings This method is implemented by subclasses as necessary.

param
classLoader

public java.lang.Objectexecute()
INTERNAL: This can be used by collection such as cursored stream to gain control over execution.

        throw QueryException.methodNotValid(this, "execute()");
    
protected java.lang.reflect.ConstructorgetConstructor()
INTERNAL: Return the size constructor if available.

        return constructor;
    
public java.lang.ClassgetContainerClass()
INTERNAL: Return the class used for the container.

        throw QueryException.methodNotValid(this, "getContainerClass()");
    
public java.lang.StringgetContainerClassName()
INTERNAL: Used by the MW

        throw QueryException.methodNotValid(this, "getContainerClassName()");
    
public oracle.toplink.essentials.descriptors.ClassDescriptorgetElementDescriptor()
INTERNAL: Used for wrapping and unwrapping with the wrapper policy.

        return elementDescriptor;
    
public booleanhasElementDescriptor()
INTERNAL: Used for wrapping and unwrapping with the wrapper policy.

        return getElementDescriptor() != null;
    
public abstract booleanhasNext(java.lang.Object iterator)
INTERNAL: Return whether the iterator has more objects. The iterator is the one returned from #iteratorFor(). Valid for some subclasses only.

see
ContainerPolicy#iteratorFor(java.lang.Object)

public booleanhasOrder()
INTERNAL: Returns true if the collection has order

        return false;
    
public voidinitializeConstructor()
INTERNAL: Find the size constructor. Providing a size is important for performance.

        try {
            Constructor constructor = null;
            if (PrivilegedAccessHelper.shouldUsePrivilegedAccess()){
                try {
                    constructor = (Constructor)AccessController.doPrivileged(new PrivilegedGetConstructorFor(getContainerClass(), new Class[] { ClassConstants.PINT }, false));
                } catch (PrivilegedActionException exception) {
                    // If there is no constructor then the default will be used.
                    return;
                }
            } else {
                constructor = PrivilegedAccessHelper.getConstructorFor(getContainerClass(), new Class[] { ClassConstants.PINT }, false);
            }
            setConstructor(constructor);
        } catch (Exception exception) {
            // If there is no constructor then the default will be used.
            return;
        }
    
public booleanisCollectionPolicy()

        return false;
    
public booleanisCursorPolicy()

        return false;
    
public booleanisCursorStreamPolicy()

        return false;
    
public booleanisCursoredStreamPolicy()
Is this a Cursored stream?

        return false;
    
public booleanisDirectMapPolicy()

        return false;
    
public booleanisEmpty(java.lang.Object container)
INTERNAL: Return whether the container is empty.

        return sizeFor(container) == 0;
    
public booleanisListPolicy()

        return false;
    
public booleanisMapPolicy()

        return false;
    
public booleanisScrollableCursorPolicy()

        return false;
    
public booleanisValidContainer(java.lang.Object container)
INTERNAL: Return whether the specified object is of a valid container type.

see
oracle.toplink.essentials.internal.queryframework.CollectionContainerPolicy#isValidContainer(Object)
see
oracle.toplink.essentials.internal.queryframework.MapContainerPolicy#isValidContainer(Object)

        throw QueryException.methodNotValid(this, "isValidContainer(Object container)");
    
public booleanisValidContainerType(java.lang.Class containerType)
INTERNAL: Return whether the specified type is a valid container type.

        throw QueryException.methodNotValid(this, "isValidContainerType(Class containerType)");
    
public abstract java.lang.ObjectiteratorFor(java.lang.Object container)
INTERNAL: Return an iterator for the given container. This iterator can then be used as a parameter to #hasNext() and #next().

see
ContainerPolicy#hasNext(java.lang.Object)
see
ContainerPolicy#next(java.lang.Object)

public java.lang.ObjectkeyFrom(java.lang.Object element, oracle.toplink.essentials.internal.sessions.AbstractSession session)
INTERNAL: Return the key for the specified element.

param
element java.lang.Object
return
java.lang.Object

        return null;
    
public java.lang.ObjectmergeCascadeParts(oracle.toplink.essentials.internal.sessions.ObjectChangeSet objectChanges, oracle.toplink.essentials.internal.sessions.MergeManager mergeManager, oracle.toplink.essentials.internal.sessions.AbstractSession parentSession)
INTERNAL: Merge changes from the source to the target object. Because this is a collection mapping, values are added to or removed from the collection based on the change set.

        Object object = null;
                
        if (mergeManager.shouldMergeChangesIntoDistributedCache()) {
            // CR 2855 - Try to find the object first we may have merged it already.
            object = objectChanges.getTargetVersionOfSourceObject(parentSession);
                        
            if ((object == null) && (objectChanges.isNew() || objectChanges.isAggregate()) && objectChanges.containsChangesFromSynchronization()) {
                if (!mergeManager.getObjectsAlreadyMerged().containsKey(objectChanges)) {
                    // CR 2855 - If we haven't merged this object already then 
                    // build a new object otherwise leave it as null which will 
                    // stop the recursion.
                    // CR 3424  - Need to build the right instance based on 
                    // class type instead of referenceDescriptor.
                    Class objectClass = objectChanges.getClassType(mergeManager.getSession());
                    object = mergeManager.getSession().getDescriptor(objectClass).getObjectBuilder().buildNewInstance();
                    // Store the change set to prevent us from creating this new object again.
                    mergeManager.getObjectsAlreadyMerged().put(objectChanges, object);
                } else {
                    // CR 4012 - We have all ready created the object, must be 
                    // in a cyclic merge on a new object so get it out of the 
                    // already merged collection
                    object = mergeManager.getObjectsAlreadyMerged().get(objectChanges);
                }
            } else {
                object = objectChanges.getTargetVersionOfSourceObject(parentSession, true);
            }
                        
            if (objectChanges.containsChangesFromSynchronization()) {
                mergeManager.mergeChanges(object, objectChanges);
            }
        } else {
            mergeManager.mergeChanges(objectChanges.getUnitOfWorkClone(), objectChanges);
        }
        
        return object;            
    
public voidmergeChanges(oracle.toplink.essentials.internal.sessions.CollectionChangeRecord changeRecord, java.lang.Object valueOfTarget, boolean shouldMergeCascadeParts, oracle.toplink.essentials.internal.sessions.MergeManager mergeManager, oracle.toplink.essentials.internal.sessions.AbstractSession parentSession)
INTERNAL: Merge changes from the source to the target object. Because this is a collection mapping, values are added to or removed from the collection based on the change set.

        ObjectChangeSet objectChanges;
        
        // Step 1 - iterate over the removed changes and remove them from the container.
        Enumeration removeObjects = changeRecord.getRemoveObjectList().keys();
            
        while (removeObjects.hasMoreElements()) {
            objectChanges = (ObjectChangeSet) removeObjects.nextElement();
            
            synchronized (valueOfTarget) {
                removeFrom(objectChanges.getOldKey(), objectChanges.getTargetVersionOfSourceObject(mergeManager.getSession()), valueOfTarget, parentSession);
            }
            
            if (!mergeManager.shouldMergeChangesIntoDistributedCache()) {
                mergeManager.registerRemovedNewObjectIfRequired(objectChanges.getUnitOfWorkClone());
            }
        }
            
        // Step 2 - iterate over the added changes and add them to the container.
        Enumeration addObjects = changeRecord.getAddObjectList().keys();
            
        while (addObjects.hasMoreElements()) {
            objectChanges = (ObjectChangeSet) addObjects.nextElement();
            Object object = null;
                
            if (shouldMergeCascadeParts) {
                object = mergeCascadeParts(objectChanges, mergeManager, parentSession);
            }
                
            if (object == null) {
                // Retrieve the object to be added to the collection.
                object = objectChanges.getTargetVersionOfSourceObject(mergeManager.getSession(), false);
            }
    
            synchronized (valueOfTarget) {
                // I am assuming that at this point the above merge will have created a new object if required
                if (mergeManager.shouldMergeChangesIntoDistributedCache()) {
                    //bug#4458089 and 4454532- check if collection contains new item before adding during merge into distributed cache					
                    if (!contains(object, valueOfTarget, mergeManager.getSession())) {
                        addInto(objectChanges.getNewKey(), object, valueOfTarget, mergeManager.getSession());
                    }
                } else {
                    addInto(objectChanges.getNewKey(), object, valueOfTarget, mergeManager.getSession());    
                }
            }
        }
    
protected abstract java.lang.Objectnext(java.lang.Object iterator)
INTERNAL: Return the next object on the queue. The iterator is the one returned from #iteratorFor(). Valid for some subclasses only.

see
ContainerPolicy#iteratorFor(java.lang.Object)

public java.lang.Objectnext(java.lang.Object iterator, oracle.toplink.essentials.internal.sessions.AbstractSession session)
INTERNAL: Return the next object from the iterator. This is used to stream over a collection independent of JDK 1.1 and 1.2. The session may be required to unwrap for the wrapper policy.

        Object next = next(iterator);
        if (hasElementDescriptor()) {
            next = getElementDescriptor().getObjectBuilder().unwrapObject(next, session);
        }
        return next;
    
public booleanoverridesRead()
This can be used by collection such as cursored stream to gain control over execution.

        return false;
    
public voidprepare(DatabaseQuery query, oracle.toplink.essentials.internal.sessions.AbstractSession session)
Prepare and validate. Allow subclasses to override.

        if (query.isReadAllQuery() && (!query.isReportQuery()) && query.shouldUseWrapperPolicy()) {
            setElementDescriptor(query.getDescriptor());
            //make sure DataReadQuery points to this container policy
        } else if (query.isDataReadQuery()) {
            ((DataReadQuery)query).setContainerPolicy(this);
        }
    
public voidprepareForExecution()
Prepare and validate. Allow subclasses to override.

    
public voidrecordAddToCollectionInChangeRecord(oracle.toplink.essentials.internal.sessions.ObjectChangeSet changeSetToAdd, oracle.toplink.essentials.internal.sessions.CollectionChangeRecord collectionChangeRecord)
This method is used to bridge the behaviour between Attribute Change Tracking and deferred change tracking with respect to adding the same instance multiple times. Each containerplicy type will implement specific behaviour for the collection type it is wrapping. These methods are only valid for collections containing object references

        if (collectionChangeRecord.getRemoveObjectList().containsKey(changeSetToAdd)) {
            collectionChangeRecord.getRemoveObjectList().remove(changeSetToAdd);
        } else {
            collectionChangeRecord.getAddObjectList().put(changeSetToAdd, changeSetToAdd);
        }
    
public voidrecordRemoveFromCollectionInChangeRecord(oracle.toplink.essentials.internal.sessions.ObjectChangeSet changeSetToRemove, oracle.toplink.essentials.internal.sessions.CollectionChangeRecord collectionChangeRecord)
This method is used to bridge the behaviour between Attribute Change Tracking and deferred change tracking with respect to adding the same instance multiple times. Each containerplicy type will implement specific behaviour for the collection type it is wrapping. These methods are only valid for collections containing object references

        if(collectionChangeRecord.getAddObjectList().containsKey(changeSetToRemove)) {
            collectionChangeRecord.getAddObjectList().remove(changeSetToRemove);
        } else {
            collectionChangeRecord.getRemoveObjectList().put(changeSetToRemove, changeSetToRemove);
        }
    
public java.lang.ObjectremoteExecute()
This can be used by collection such as cursored stream to gain control over execution.

        return null;
    
public voidremoveAllElements(java.lang.Object container)
INTERNAL: Remove all the elements from container. Valid only for certain subclasses.

        clear(container);
    
protected booleanremoveFrom(java.lang.Object key, java.lang.Object element, java.lang.Object container)
INTERNAL: Remove element from container. Valid for some subclasses only.

        throw QueryException.cannotRemoveFromContainer(element, container, this);
    
public booleanremoveFrom(java.lang.Object key, java.lang.Object element, java.lang.Object container, oracle.toplink.essentials.internal.sessions.AbstractSession session)
INTERNAL: Remove the object from the collection. This is used to remove from a collection independent of JDK 1.1 and 1.2. The session may be required to unwrap for the wrapper policy.

        Object objectToRemove = element;
        if (hasElementDescriptor() && getElementDescriptor().hasWrapperPolicy()) {
            // The wrapper for the object must be removed.
            Object iterator = iteratorFor(container);
            while (hasNext(iterator)) {
                Object next = next(iterator);
                if (getElementDescriptor().getObjectBuilder().unwrapObject(next, session).equals(element)) {
                    objectToRemove = next;
                    break;
                }
            }
        }

        return removeFrom(key, objectToRemove, container);
    
public booleanremoveFrom(java.lang.Object element, java.lang.Object container, oracle.toplink.essentials.internal.sessions.AbstractSession session)
INTERNAL: Remove the object from the collection. This is used to remove from a collection independent of JDK 1.1 and 1.2. The session may be required to unwrap for the wrapper policy.

        return removeFrom(null, element, container, session);
    
public voidremoveFromWithOrder(int beginIndex, java.lang.Object container)
INTERNAL: It is illegal to send this message to this receiver. Try one of my subclasses. Throws an exception.

see
#ListContainerPolicy

        throw QueryException.methodDoesNotExistInContainerClass("remove(index)", getContainerClass());
    
protected voidsetConstructor(java.lang.reflect.Constructor constructor)
INTERNAL: Set the size constructor if available.

        this.constructor = constructor;
    
public voidsetContainerClass(java.lang.Class containerClass)
INTERNAL: Set the class used for the container.

        throw QueryException.methodNotValid(this, "getContainerClass()");
    
public voidsetContainerClassName(java.lang.String containerClassName)
INTERNAL: Used by the MW

        throw QueryException.methodNotValid(this, "getContainerClassName()");
    
public voidsetElementDescriptor(oracle.toplink.essentials.descriptors.ClassDescriptor elementDescriptor)
INTERNAL: Used for wrapping and unwrapping with the wrapper policy.

        this.elementDescriptor = elementDescriptor;
    
public voidsetKeyName(java.lang.String instanceVariableName, java.lang.String elementClassName)
INTERNAL: It is illegal to send this message to this receiver. Try one of my subclasses. Throws an exception.

see
#MapContainerPolicy

        throw ValidationException.containerPolicyDoesNotUseKeys(this, instanceVariableName);
    
public intsizeFor(java.lang.Object container)
INTERNAL: Return the size of container.

        throw QueryException.methodNotValid(this, "sizeFor(Object container)");
    
public java.lang.StringtoString()

        return Helper.getShortClassName(this.getClass()) + "(" + toStringInfo() + ")";
    
protected java.lang.ObjecttoStringInfo()

        return "";
    
public voidvalidateElementAndRehashIfRequired(java.lang.Object sourceValue, java.lang.Object target, oracle.toplink.essentials.internal.sessions.AbstractSession session, java.lang.Object targetVersionOfSource)
INTERNAL: over ride in MapPolicy subclass

        //do nothing
    
public java.util.VectorvectorFor(java.lang.Object container, oracle.toplink.essentials.internal.sessions.AbstractSession session)
INTERNAL: Return a Vector populated with the contents of container. Added for bug 2766379, must implement a version of vectorFor that handles wrapped objects.

        Vector result = new Vector(sizeFor(container));

        for (Object iter = iteratorFor(container); hasNext(iter);) {
            result.addElement(next(iter, session));
        }
        return result;