Package org.apache.openjpa.util.proxy
Class DelayedVectorProxy
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.Vector
-
- org.apache.openjpa.util.proxy.DelayedVectorProxy
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Iterable
,Collection
,List
,RandomAccess
,Proxy
,DelayedProxy
,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
Constructors Constructor Description DelayedVectorProxy()
DelayedVectorProxy(int paramInt)
DelayedVectorProxy(int paramInt1, int paramInt2)
DelayedVectorProxy(Collection paramCollection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int paramInt, Object paramObject)
boolean
add(Object paramObject)
boolean
addAll(int paramInt, Collection paramCollection)
boolean
addAll(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)
Object[]
toArray(IntFunction generator)
String
toString()
void
trimToSize()
protected 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
-
-
-
-
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.
-
getDelayedField
public int getDelayedField()
Description copied from interface:DelayedProxy
Returns the expected field index even if this collection was detached.- Specified by:
getDelayedField
in interfaceDelayedProxy
-
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 interfaceDelayedProxy
-
getOwner
public OpenJPAStateManager getOwner()
Description copied from interface:Proxy
Return the owning object.
-
getOwnerField
public int getOwnerField()
Description copied from interface:Proxy
Return the owning field index.- Specified by:
getOwnerField
in interfaceProxy
-
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 interfaceDelayedProxy
-
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 interfaceDelayedProxy
-
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 interfaceDelayedProxy
-
getBroker
public Broker getBroker()
Description copied from interface:DelayedProxy
Get the broker that is used to service this proxy.- Specified by:
getBroker
in interfaceDelayedProxy
-
closeBroker
public void closeBroker()
Description copied from interface:DelayedProxy
Close the broker that is used to service this proxy.- Specified by:
closeBroker
in interfaceDelayedProxy
-
getOwnerStateManager
public OpenJPAStateManager getOwnerStateManager()
Description copied from interface:DelayedProxy
Returns the state manager of the owning instance.- Specified by:
getOwnerStateManager
in interfaceDelayedProxy
-
isDetached
public boolean isDetached()
Description copied from interface:DelayedProxy
Returns whether the proxy is detached.- Specified by:
isDetached
in interfaceDelayedProxy
-
isDelayLoad
public boolean isDelayLoad()
-
getChangeTracker
public ChangeTracker getChangeTracker()
Description copied from interface:Proxy
Return the change tracker for this proxy, or null if none.- Specified by:
getChangeTracker
in interfaceProxy
-
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.
-
getElementType
public Class getElementType()
Description copied from interface:ProxyCollection
The collection element type.- Specified by:
getElementType
in interfaceProxyCollection
-
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 interfaceProxyCollection
-
add
public boolean add(Object paramObject)
-
add
public void add(int paramInt, Object paramObject)
-
clear
public void clear()
-
addAll
public boolean addAll(int paramInt, Collection paramCollection)
-
addAll
public boolean addAll(Collection paramCollection)
-
addElement
public void addElement(Object paramObject)
- Overrides:
addElement
in classVector
-
remove
public Object remove(int paramInt)
-
remove
public boolean remove(Object paramObject)
-
removeAll
public boolean removeAll(Collection paramCollection)
-
retainAll
public boolean retainAll(Collection paramCollection)
-
insertElementAt
public void insertElementAt(Object paramObject, int paramInt)
- Overrides:
insertElementAt
in classVector
-
removeAllElements
public void removeAllElements()
- Overrides:
removeAllElements
in classVector
-
removeElement
public boolean removeElement(Object paramObject)
- Overrides:
removeElement
in classVector
-
removeElementAt
public void removeElementAt(int paramInt)
- Overrides:
removeElementAt
in classVector
-
setElementAt
public void setElementAt(Object paramObject, int paramInt)
- Overrides:
setElementAt
in classVector
-
iterator
public Iterator iterator()
-
listIterator
public ListIterator listIterator(int paramInt)
- Specified by:
listIterator
in interfaceList
- Overrides:
listIterator
in classVector
-
listIterator
public ListIterator listIterator()
- Specified by:
listIterator
in interfaceList
- Overrides:
listIterator
in classVector
-
writeReplace
protected Object writeReplace() throws ObjectStreamException
- Throws:
ObjectStreamException
-
contains
public boolean contains(Object object)
-
containsAll
public boolean containsAll(Collection collection)
- Specified by:
containsAll
in interfaceCollection
- Specified by:
containsAll
in interfaceList
- Overrides:
containsAll
in classVector
-
isEmpty
public boolean isEmpty()
-
size
public int size()
-
toArray
public Object[] toArray()
-
toArray
public Object[] toArray(IntFunction generator)
- Specified by:
toArray
in interfaceCollection
-
equals
public boolean equals(Object paramObject)
-
hashCode
public int hashCode()
-
lastIndexOf
public int lastIndexOf(Object object)
- Specified by:
lastIndexOf
in interfaceList
- Overrides:
lastIndexOf
in classVector
-
subList
public List subList(int start, int end)
-
get
public Object get(int location)
-
indexOf
public int indexOf(Object object)
-
trimToSize
public void trimToSize()
- Overrides:
trimToSize
in classVector
-
ensureCapacity
public void ensureCapacity(int minCapacity)
- Overrides:
ensureCapacity
in classVector
-
elements
public Enumeration elements()
-
lastIndexOf
public int lastIndexOf(Object o, int index)
- Overrides:
lastIndexOf
in classVector
-
firstElement
public Object firstElement()
- Overrides:
firstElement
in classVector
-
lastElement
public Object lastElement()
- Overrides:
lastElement
in classVector
-
removeRange
protected void removeRange(int fromIndex, int toIndex)
- Overrides:
removeRange
in classVector
-
-