Class DelayedVectorProxy

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.lang.Iterable, java.util.Collection, java.util.List, java.util.RandomAccess, Proxy, DelayedProxy, ProxyCollection

    public class DelayedVectorProxy
    extends java.util.Vector
    implements ProxyCollection, DelayedProxy
    Vector proxy with delay loading capability. Allows non-indexed add and remove operations to occur on an unloaded collection. Operations that require a load will trigger a load.
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class java.util.Vector

        capacityIncrement, elementCount, elementData
      • Fields inherited from class java.util.AbstractList

        modCount
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(int paramInt, java.lang.Object paramObject)  
      boolean add​(java.lang.Object paramObject)  
      boolean addAll​(int paramInt, java.util.Collection paramCollection)  
      boolean addAll​(java.util.Collection paramCollection)  
      void addElement​(java.lang.Object paramObject)  
      int capacity()  
      void clear()  
      java.lang.Object clone()  
      void closeBroker()
      Close the broker that is used to service this proxy.
      boolean contains​(java.lang.Object object)  
      boolean containsAll​(java.util.Collection collection)  
      java.lang.Object copy​(java.lang.Object paramObject)
      Return an unproxied copy of the given instance.
      void copyInto​(java.lang.Object[] anArray)  
      java.lang.Object elementAt​(int index)  
      java.util.Enumeration elements()  
      void ensureCapacity​(int minCapacity)  
      boolean equals​(java.lang.Object paramObject)  
      java.lang.Object firstElement()  
      java.lang.Object get​(int location)  
      Broker getBroker()
      Get the broker that is used to service this proxy.
      BrokerFactory getBrokerFactory()  
      ChangeTracker getChangeTracker()
      Return the change tracker for this proxy, or null if none.
      int getDelayedField()
      Returns the expected field index even if this collection was detached.
      OpenJPAStateManager getDelayedOwner()
      Returns a state manager that can service this proxy even if the collection was detached.
      java.lang.Class getElementType()
      The collection element type.
      OpenJPAStateManager getOwner()
      Return the owning object.
      int getOwnerField()
      Return the owning field index.
      OpenJPAStateManager getOwnerStateManager()
      Returns the state manager of the owning instance.
      int hashCode()  
      int indexOf​(java.lang.Object object)  
      int indexOf​(java.lang.Object object, int index)  
      void insertElementAt​(java.lang.Object paramObject, int paramInt)  
      boolean isDelayLoad()  
      boolean isDetached()
      Returns whether the proxy is detached.
      boolean isDirectAccess()
      Returns whether the caller has direct-call access to the proxied object.
      boolean isEmpty()  
      java.util.Iterator iterator()  
      java.lang.Object lastElement()  
      int lastIndexOf​(java.lang.Object object)  
      int lastIndexOf​(java.lang.Object o, int index)  
      java.util.ListIterator listIterator()  
      java.util.ListIterator listIterator​(int paramInt)  
      void load()
      Load the proxy if it was delay-loaded.
      ProxyCollection newInstance​(java.lang.Class paramClass, java.util.Comparator paramComparator, boolean paramBoolean1, boolean paramBoolean2)
      Create a new instance of this proxy type.
      java.lang.Object remove​(int paramInt)  
      boolean remove​(java.lang.Object paramObject)  
      boolean removeAll​(java.util.Collection paramCollection)  
      void removeAllElements()  
      boolean removeElement​(java.lang.Object paramObject)  
      void removeElementAt​(int paramInt)  
      protected void removeRange​(int fromIndex, int toIndex)  
      boolean retainAll​(java.util.Collection paramCollection)  
      java.lang.Object set​(int paramInt, java.lang.Object paramObject)  
      protected void setChangeTracker​(CollectionChangeTracker ct)  
      void setDirectAccess​(boolean direct)
      Sets whether the caller has direct-call access to the proxied object.
      void setElementAt​(java.lang.Object paramObject, int paramInt)  
      protected void setElementType​(java.lang.Class<?> elemType)  
      void setOwner​(OpenJPAStateManager paramOpenJPAStateManager, int paramInt)
      Reset the state of the proxy, and set the owning instance of the proxy and the name of the field it is assigned to.
      void setSize​(int paramInt)  
      int size()  
      java.util.List subList​(int start, int end)  
      java.lang.Object[] toArray()  
      java.lang.Object[] toArray​(java.lang.Object[] array)  
      java.lang.Object[] toArray​(java.util.function.IntFunction generator)  
      java.lang.String toString()  
      void trimToSize()  
      protected java.lang.Object writeReplace()  
      • Methods inherited from class java.util.Vector

        forEach, removeIf, replaceAll, sort, spliterator
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Collection

        parallelStream, removeIf, stream
      • Methods inherited from interface java.lang.Iterable

        forEach
    • Constructor Detail

      • DelayedVectorProxy

        public DelayedVectorProxy​(int paramInt)
      • DelayedVectorProxy

        public DelayedVectorProxy()
      • DelayedVectorProxy

        public DelayedVectorProxy​(java.util.Collection paramCollection)
      • DelayedVectorProxy

        public DelayedVectorProxy​(int paramInt1,
                                  int paramInt2)
    • Method Detail

      • setOwner

        public void setOwner​(OpenJPAStateManager paramOpenJPAStateManager,
                             int paramInt)
        Description copied from interface: Proxy
        Reset the state of the proxy, and set the owning instance of the proxy and the name of the field it is assigned to. Set to null to indicate that the proxy is no longer managed.
        Specified by:
        setOwner in interface Proxy
      • getDelayedField

        public int getDelayedField()
        Description copied from interface: DelayedProxy
        Returns the expected field index even if this collection was detached.
        Specified by:
        getDelayedField in interface DelayedProxy
      • getOwnerField

        public int getOwnerField()
        Description copied from interface: Proxy
        Return the owning field index.
        Specified by:
        getOwnerField in interface Proxy
      • isDirectAccess

        public boolean isDirectAccess()
        Description copied from interface: DelayedProxy
        Returns whether the caller has direct-call access to the proxied object. Direct access allows calls to be made on the object without triggering a load or proxy state tracking callbacks.
        Specified by:
        isDirectAccess in interface DelayedProxy
      • setDirectAccess

        public void setDirectAccess​(boolean direct)
        Description copied from interface: DelayedProxy
        Sets whether the caller has direct-call access to the proxied object. Direct access allows calls to be made on the object without triggering a load or proxy state tracking callbacks.
        Specified by:
        setDirectAccess in interface DelayedProxy
      • load

        public void load()
        Description copied from interface: DelayedProxy
        Load the proxy if it was delay-loaded.
        Specified by:
        load in interface DelayedProxy
      • closeBroker

        public void closeBroker()
        Description copied from interface: DelayedProxy
        Close the broker that is used to service this proxy.
        Specified by:
        closeBroker in interface DelayedProxy
      • isDetached

        public boolean isDetached()
        Description copied from interface: DelayedProxy
        Returns whether the proxy is detached.
        Specified by:
        isDetached in interface DelayedProxy
      • isDelayLoad

        public boolean isDelayLoad()
      • clone

        public java.lang.Object clone()
        Overrides:
        clone in class java.util.Vector
      • getChangeTracker

        public ChangeTracker getChangeTracker()
        Description copied from interface: Proxy
        Return the change tracker for this proxy, or null if none.
        Specified by:
        getChangeTracker in interface Proxy
      • copy

        public java.lang.Object copy​(java.lang.Object paramObject)
        Description copied from interface: Proxy
        Return an unproxied copy of the given instance. This method is used by proxy managers to create backup values for use in rollback.
        Specified by:
        copy in interface Proxy
      • setElementType

        protected void setElementType​(java.lang.Class<?> elemType)
      • newInstance

        public ProxyCollection newInstance​(java.lang.Class paramClass,
                                           java.util.Comparator paramComparator,
                                           boolean paramBoolean1,
                                           boolean paramBoolean2)
        Description copied from interface: ProxyCollection
        Create a new instance of this proxy type.
        Specified by:
        newInstance in interface ProxyCollection
      • add

        public boolean add​(java.lang.Object paramObject)
        Specified by:
        add in interface java.util.Collection
        Specified by:
        add in interface java.util.List
        Overrides:
        add in class java.util.Vector
      • add

        public void add​(int paramInt,
                        java.lang.Object paramObject)
        Specified by:
        add in interface java.util.List
        Overrides:
        add in class java.util.Vector
      • clear

        public void clear()
        Specified by:
        clear in interface java.util.Collection
        Specified by:
        clear in interface java.util.List
        Overrides:
        clear in class java.util.Vector
      • addAll

        public boolean addAll​(int paramInt,
                              java.util.Collection paramCollection)
        Specified by:
        addAll in interface java.util.List
        Overrides:
        addAll in class java.util.Vector
      • addAll

        public boolean addAll​(java.util.Collection paramCollection)
        Specified by:
        addAll in interface java.util.Collection
        Specified by:
        addAll in interface java.util.List
        Overrides:
        addAll in class java.util.Vector
      • addElement

        public void addElement​(java.lang.Object paramObject)
        Overrides:
        addElement in class java.util.Vector
      • remove

        public java.lang.Object remove​(int paramInt)
        Specified by:
        remove in interface java.util.List
        Overrides:
        remove in class java.util.Vector
      • remove

        public boolean remove​(java.lang.Object paramObject)
        Specified by:
        remove in interface java.util.Collection
        Specified by:
        remove in interface java.util.List
        Overrides:
        remove in class java.util.Vector
      • set

        public java.lang.Object set​(int paramInt,
                                    java.lang.Object paramObject)
        Specified by:
        set in interface java.util.List
        Overrides:
        set in class java.util.Vector
      • removeAll

        public boolean removeAll​(java.util.Collection paramCollection)
        Specified by:
        removeAll in interface java.util.Collection
        Specified by:
        removeAll in interface java.util.List
        Overrides:
        removeAll in class java.util.Vector
      • retainAll

        public boolean retainAll​(java.util.Collection paramCollection)
        Specified by:
        retainAll in interface java.util.Collection
        Specified by:
        retainAll in interface java.util.List
        Overrides:
        retainAll in class java.util.Vector
      • insertElementAt

        public void insertElementAt​(java.lang.Object paramObject,
                                    int paramInt)
        Overrides:
        insertElementAt in class java.util.Vector
      • removeAllElements

        public void removeAllElements()
        Overrides:
        removeAllElements in class java.util.Vector
      • removeElement

        public boolean removeElement​(java.lang.Object paramObject)
        Overrides:
        removeElement in class java.util.Vector
      • removeElementAt

        public void removeElementAt​(int paramInt)
        Overrides:
        removeElementAt in class java.util.Vector
      • setElementAt

        public void setElementAt​(java.lang.Object paramObject,
                                 int paramInt)
        Overrides:
        setElementAt in class java.util.Vector
      • iterator

        public java.util.Iterator iterator()
        Specified by:
        iterator in interface java.util.Collection
        Specified by:
        iterator in interface java.lang.Iterable
        Specified by:
        iterator in interface java.util.List
        Overrides:
        iterator in class java.util.Vector
      • listIterator

        public java.util.ListIterator listIterator​(int paramInt)
        Specified by:
        listIterator in interface java.util.List
        Overrides:
        listIterator in class java.util.Vector
      • listIterator

        public java.util.ListIterator listIterator()
        Specified by:
        listIterator in interface java.util.List
        Overrides:
        listIterator in class java.util.Vector
      • setSize

        public void setSize​(int paramInt)
        Overrides:
        setSize in class java.util.Vector
      • writeReplace

        protected java.lang.Object writeReplace()
                                         throws java.io.ObjectStreamException
        Throws:
        java.io.ObjectStreamException
      • contains

        public boolean contains​(java.lang.Object object)
        Specified by:
        contains in interface java.util.Collection
        Specified by:
        contains in interface java.util.List
        Overrides:
        contains in class java.util.Vector
      • containsAll

        public boolean containsAll​(java.util.Collection collection)
        Specified by:
        containsAll in interface java.util.Collection
        Specified by:
        containsAll in interface java.util.List
        Overrides:
        containsAll in class java.util.Vector
      • isEmpty

        public boolean isEmpty()
        Specified by:
        isEmpty in interface java.util.Collection
        Specified by:
        isEmpty in interface java.util.List
        Overrides:
        isEmpty in class java.util.Vector
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection
        Specified by:
        size in interface java.util.List
        Overrides:
        size in class java.util.Vector
      • toArray

        public java.lang.Object[] toArray()
        Specified by:
        toArray in interface java.util.Collection
        Specified by:
        toArray in interface java.util.List
        Overrides:
        toArray in class java.util.Vector
      • toArray

        public java.lang.Object[] toArray​(java.lang.Object[] array)
        Specified by:
        toArray in interface java.util.Collection
        Specified by:
        toArray in interface java.util.List
        Overrides:
        toArray in class java.util.Vector
      • toArray

        public java.lang.Object[] toArray​(java.util.function.IntFunction generator)
        Specified by:
        toArray in interface java.util.Collection
      • equals

        public boolean equals​(java.lang.Object paramObject)
        Specified by:
        equals in interface java.util.Collection
        Specified by:
        equals in interface java.util.List
        Overrides:
        equals in class java.util.Vector
      • hashCode

        public int hashCode()
        Specified by:
        hashCode in interface java.util.Collection
        Specified by:
        hashCode in interface java.util.List
        Overrides:
        hashCode in class java.util.Vector
      • lastIndexOf

        public int lastIndexOf​(java.lang.Object object)
        Specified by:
        lastIndexOf in interface java.util.List
        Overrides:
        lastIndexOf in class java.util.Vector
      • subList

        public java.util.List subList​(int start,
                                      int end)
        Specified by:
        subList in interface java.util.List
        Overrides:
        subList in class java.util.Vector
      • get

        public java.lang.Object get​(int location)
        Specified by:
        get in interface java.util.List
        Overrides:
        get in class java.util.Vector
      • indexOf

        public int indexOf​(java.lang.Object object)
        Specified by:
        indexOf in interface java.util.List
        Overrides:
        indexOf in class java.util.Vector
      • indexOf

        public int indexOf​(java.lang.Object object,
                           int index)
        Overrides:
        indexOf in class java.util.Vector
      • copyInto

        public void copyInto​(java.lang.Object[] anArray)
        Overrides:
        copyInto in class java.util.Vector
      • trimToSize

        public void trimToSize()
        Overrides:
        trimToSize in class java.util.Vector
      • ensureCapacity

        public void ensureCapacity​(int minCapacity)
        Overrides:
        ensureCapacity in class java.util.Vector
      • capacity

        public int capacity()
        Overrides:
        capacity in class java.util.Vector
      • elements

        public java.util.Enumeration elements()
        Overrides:
        elements in class java.util.Vector
      • lastIndexOf

        public int lastIndexOf​(java.lang.Object o,
                               int index)
        Overrides:
        lastIndexOf in class java.util.Vector
      • elementAt

        public java.lang.Object elementAt​(int index)
        Overrides:
        elementAt in class java.util.Vector
      • firstElement

        public java.lang.Object firstElement()
        Overrides:
        firstElement in class java.util.Vector
      • lastElement

        public java.lang.Object lastElement()
        Overrides:
        lastElement in class java.util.Vector
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.util.Vector
      • removeRange

        protected void removeRange​(int fromIndex,
                                   int toIndex)
        Overrides:
        removeRange in class java.util.Vector