org.apache.openjpa.util
Class DelayedVectorProxy

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.Vector
              extended by org.apache.openjpa.util.DelayedVectorProxy
All Implemented Interfaces:
Serializable, Cloneable, Iterable, Collection, List, RandomAccess, DelayedProxy, Proxy, ProxyCollection

public class DelayedVectorProxy
extends 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
 
Constructor Summary
DelayedVectorProxy()
           
DelayedVectorProxy(Collection paramCollection)
           
DelayedVectorProxy(int paramInt)
           
DelayedVectorProxy(int paramInt1, int paramInt2)
           
 
Method Summary
 void add(int paramInt, Object paramObject)
           
 boolean add(Object paramObject)
           
 boolean addAll(Collection paramCollection)
           
 boolean addAll(int paramInt, Collection paramCollection)
           
 void addElement(Object paramObject)
           
 int capacity()
           
 void clear()
           
 Object clone()
           
 void closeBroker()
          Close the broker that is used to service this proxy.
 boolean contains(Object object)
           
 boolean containsAll(Collection collection)
           
 Object copy(Object paramObject)
          Return an unproxied copy of the given instance.
 void copyInto(Object[] anArray)
           
 Object elementAt(int index)
           
 Enumeration elements()
           
 void ensureCapacity(int minCapacity)
           
 boolean equals(Object paramObject)
           
 Object firstElement()
           
 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.
 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(Object object)
           
 int indexOf(Object object, int index)
           
 void insertElementAt(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()
           
 Iterator iterator()
           
 Object lastElement()
           
 int lastIndexOf(Object object)
           
 int lastIndexOf(Object o, int index)
           
 ListIterator listIterator()
           
 ListIterator listIterator(int paramInt)
           
 void load()
          Load the proxy if it was delay-loaded.
 ProxyCollection newInstance(Class paramClass, Comparator paramComparator, boolean paramBoolean1, boolean paramBoolean2)
          Create a new instance of this proxy type.
 Object remove(int paramInt)
           
 boolean remove(Object paramObject)
           
 boolean removeAll(Collection paramCollection)
           
 void removeAllElements()
           
 boolean removeElement(Object paramObject)
           
 void removeElementAt(int paramInt)
           
protected  void removeRange(int fromIndex, int toIndex)
           
 boolean retainAll(Collection paramCollection)
           
 Object set(int paramInt, 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(Object paramObject, int paramInt)
           
protected  void setElementType(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()
           
 List subList(int start, int end)
           
 Object[] toArray()
           
 Object[] toArray(Object[] array)
           
 String toString()
           
 void trimToSize()
           
protected  Object writeReplace()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DelayedVectorProxy

public DelayedVectorProxy(int paramInt)

DelayedVectorProxy

public DelayedVectorProxy()

DelayedVectorProxy

public DelayedVectorProxy(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
Returns:

getDelayedOwner

public OpenJPAStateManager getDelayedOwner()
Description copied from interface: DelayedProxy
Returns a state manager that can service this proxy even if the collection was detached.

Specified by:
getDelayedOwner in interface DelayedProxy

getOwner

public OpenJPAStateManager getOwner()
Description copied from interface: Proxy
Return the owning object.

Specified by:
getOwner in interface Proxy

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

getBrokerFactory

public BrokerFactory getBrokerFactory()

load

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

Specified by:
load in interface DelayedProxy

getBroker

public Broker getBroker()
Description copied from interface: DelayedProxy
Get the broker that is used to service this proxy.

Specified by:
getBroker 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

getOwnerStateManager

public OpenJPAStateManager getOwnerStateManager()
Description copied from interface: DelayedProxy
Returns the state manager of the owning instance.

Specified by:
getOwnerStateManager in interface DelayedProxy

isDetached

public boolean isDetached()
Description copied from interface: DelayedProxy
Returns whether the proxy is detached.

Specified by:
isDetached in interface DelayedProxy
Returns:

isDelayLoad

public boolean isDelayLoad()

clone

public Object clone()
Overrides:
clone in class 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

setChangeTracker

protected void setChangeTracker(CollectionChangeTracker ct)

copy

public Object copy(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

getElementType

public Class getElementType()
Description copied from interface: ProxyCollection
The collection element type.

Specified by:
getElementType in interface ProxyCollection

setElementType

protected void setElementType(Class<?> elemType)

newInstance

public ProxyCollection newInstance(Class paramClass,
                                   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(Object paramObject)
Specified by:
add in interface Collection
Specified by:
add in interface List
Overrides:
add in class Vector

add

public void add(int paramInt,
                Object paramObject)
Specified by:
add in interface List
Overrides:
add in class Vector

clear

public void clear()
Specified by:
clear in interface Collection
Specified by:
clear in interface List
Overrides:
clear in class Vector

addAll

public boolean addAll(int paramInt,
                      Collection paramCollection)
Specified by:
addAll in interface List
Overrides:
addAll in class Vector

addAll

public boolean addAll(Collection paramCollection)
Specified by:
addAll in interface Collection
Specified by:
addAll in interface List
Overrides:
addAll in class Vector

addElement

public void addElement(Object paramObject)
Overrides:
addElement in class Vector

remove

public Object remove(int paramInt)
Specified by:
remove in interface List
Overrides:
remove in class Vector

remove

public boolean remove(Object paramObject)
Specified by:
remove in interface Collection
Specified by:
remove in interface List
Overrides:
remove in class Vector

set

public Object set(int paramInt,
                  Object paramObject)
Specified by:
set in interface List
Overrides:
set in class Vector

removeAll

public boolean removeAll(Collection paramCollection)
Specified by:
removeAll in interface Collection
Specified by:
removeAll in interface List
Overrides:
removeAll in class Vector

retainAll

public boolean retainAll(Collection paramCollection)
Specified by:
retainAll in interface Collection
Specified by:
retainAll in interface List
Overrides:
retainAll in class Vector

insertElementAt

public void insertElementAt(Object paramObject,
                            int paramInt)
Overrides:
insertElementAt in class Vector

removeAllElements

public void removeAllElements()
Overrides:
removeAllElements in class Vector

removeElement

public boolean removeElement(Object paramObject)
Overrides:
removeElement in class Vector

removeElementAt

public void removeElementAt(int paramInt)
Overrides:
removeElementAt in class Vector

setElementAt

public void setElementAt(Object paramObject,
                         int paramInt)
Overrides:
setElementAt in class Vector

iterator

public Iterator iterator()
Specified by:
iterator in interface Iterable
Specified by:
iterator in interface Collection
Specified by:
iterator in interface List
Overrides:
iterator in class AbstractList

listIterator

public ListIterator listIterator(int paramInt)
Specified by:
listIterator in interface List
Overrides:
listIterator in class AbstractList

listIterator

public ListIterator listIterator()
Specified by:
listIterator in interface List
Overrides:
listIterator in class AbstractList

setSize

public void setSize(int paramInt)
Overrides:
setSize in class Vector

writeReplace

protected Object writeReplace()
                       throws ObjectStreamException
Throws:
ObjectStreamException

contains

public boolean contains(Object object)
Specified by:
contains in interface Collection
Specified by:
contains in interface List
Overrides:
contains in class Vector

containsAll

public boolean containsAll(Collection collection)
Specified by:
containsAll in interface Collection
Specified by:
containsAll in interface List
Overrides:
containsAll in class Vector

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection
Specified by:
isEmpty in interface List
Overrides:
isEmpty in class Vector

size

public int size()
Specified by:
size in interface Collection
Specified by:
size in interface List
Overrides:
size in class Vector

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection
Specified by:
toArray in interface List
Overrides:
toArray in class Vector

toArray

public Object[] toArray(Object[] array)
Specified by:
toArray in interface Collection
Specified by:
toArray in interface List
Overrides:
toArray in class Vector

equals

public boolean equals(Object paramObject)
Specified by:
equals in interface Collection
Specified by:
equals in interface List
Overrides:
equals in class Vector

hashCode

public int hashCode()
Specified by:
hashCode in interface Collection
Specified by:
hashCode in interface List
Overrides:
hashCode in class Vector

lastIndexOf

public int lastIndexOf(Object object)
Specified by:
lastIndexOf in interface List
Overrides:
lastIndexOf in class Vector

subList

public List subList(int start,
                    int end)
Specified by:
subList in interface List
Overrides:
subList in class Vector

get

public Object get(int location)
Specified by:
get in interface List
Overrides:
get in class Vector

indexOf

public int indexOf(Object object)
Specified by:
indexOf in interface List
Overrides:
indexOf in class Vector

indexOf

public int indexOf(Object object,
                   int index)
Overrides:
indexOf in class Vector

copyInto

public void copyInto(Object[] anArray)
Overrides:
copyInto in class Vector

trimToSize

public void trimToSize()
Overrides:
trimToSize in class Vector

ensureCapacity

public void ensureCapacity(int minCapacity)
Overrides:
ensureCapacity in class Vector

capacity

public int capacity()
Overrides:
capacity in class Vector

elements

public Enumeration elements()
Overrides:
elements in class Vector

lastIndexOf

public int lastIndexOf(Object o,
                       int index)
Overrides:
lastIndexOf in class Vector

elementAt

public Object elementAt(int index)
Overrides:
elementAt in class Vector

firstElement

public Object firstElement()
Overrides:
firstElement in class Vector

lastElement

public Object lastElement()
Overrides:
lastElement in class Vector

toString

public String toString()
Overrides:
toString in class Vector

removeRange

protected void removeRange(int fromIndex,
                           int toIndex)
Overrides:
removeRange in class Vector


Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.