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
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:
-
Field Summary
Fields inherited from class java.util.Vector
capacityIncrement, elementCount, elementData
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
ConstructorDescriptionDelayedVectorProxy
(int paramInt) DelayedVectorProxy
(int paramInt1, int paramInt2) DelayedVectorProxy
(Collection paramCollection) -
Method Summary
Modifier and TypeMethodDescriptionvoid
boolean
boolean
addAll
(int paramInt, Collection paramCollection) boolean
addAll
(Collection paramCollection) void
addElement
(Object paramObject) int
capacity()
void
clear()
clone()
void
Close the broker that is used to service this proxy.boolean
boolean
containsAll
(Collection collection) Return an unproxied copy of the given instance.void
elementAt
(int index) elements()
void
ensureCapacity
(int minCapacity) boolean
get
(int location) Get the broker that is used to service this proxy.Return the change tracker for this proxy, or null if none.int
Returns the expected field index even if this collection was detached.Returns a state manager that can service this proxy even if the collection was detached.The collection element type.getOwner()
Return the owning object.int
Return the owning field index.Returns the state manager of the owning instance.int
hashCode()
int
int
void
insertElementAt
(Object paramObject, int paramInt) boolean
boolean
Returns whether the proxy is detached.boolean
Returns whether the caller has direct-call access to the proxied object.boolean
isEmpty()
iterator()
int
lastIndexOf
(Object object) int
lastIndexOf
(Object o, int index) listIterator
(int paramInt) void
load()
Load the proxy if it was delay-loaded.newInstance
(Class paramClass, Comparator paramComparator, boolean paramBoolean1, boolean paramBoolean2) Create a new instance of this proxy type.remove
(int paramInt) boolean
boolean
removeAll
(Collection paramCollection) void
boolean
removeElement
(Object paramObject) void
removeElementAt
(int paramInt) protected void
removeRange
(int fromIndex, int toIndex) boolean
retainAll
(Collection paramCollection) protected void
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()
subList
(int start, int end) Object[]
toArray()
Object[]
Object[]
toArray
(IntFunction generator) toString()
void
protected Object
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 Details
-
DelayedVectorProxy
public DelayedVectorProxy(int paramInt) -
DelayedVectorProxy
public DelayedVectorProxy() -
DelayedVectorProxy
-
DelayedVectorProxy
public DelayedVectorProxy(int paramInt1, int paramInt2)
-
-
Method Details
-
setOwner
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
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
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
-
load
public void load()Description copied from interface:DelayedProxy
Load the proxy if it was delay-loaded.- Specified by:
load
in interfaceDelayedProxy
-
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
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() -
clone
-
getChangeTracker
Description copied from interface:Proxy
Return the change tracker for this proxy, or null if none.- Specified by:
getChangeTracker
in interfaceProxy
-
setChangeTracker
-
copy
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
Description copied from interface:ProxyCollection
The collection element type.- Specified by:
getElementType
in interfaceProxyCollection
-
setElementType
-
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
-
add
-
clear
public void clear() -
addAll
-
addAll
-
addElement
- Overrides:
addElement
in classVector
-
remove
-
remove
-
set
-
removeAll
-
retainAll
-
insertElementAt
- Overrides:
insertElementAt
in classVector
-
removeAllElements
public void removeAllElements()- Overrides:
removeAllElements
in classVector
-
removeElement
- Overrides:
removeElement
in classVector
-
removeElementAt
public void removeElementAt(int paramInt) - Overrides:
removeElementAt
in classVector
-
setElementAt
- Overrides:
setElementAt
in classVector
-
iterator
-
listIterator
- Specified by:
listIterator
in interfaceList
- Overrides:
listIterator
in classVector
-
listIterator
- Specified by:
listIterator
in interfaceList
- Overrides:
listIterator
in classVector
-
setSize
public void setSize(int paramInt) -
writeReplace
- Throws:
ObjectStreamException
-
contains
-
containsAll
- Specified by:
containsAll
in interfaceCollection
- Specified by:
containsAll
in interfaceList
- Overrides:
containsAll
in classVector
-
isEmpty
public boolean isEmpty() -
size
public int size() -
toArray
-
toArray
-
toArray
- Specified by:
toArray
in interfaceCollection
-
equals
-
hashCode
public int hashCode() -
lastIndexOf
- Specified by:
lastIndexOf
in interfaceList
- Overrides:
lastIndexOf
in classVector
-
subList
-
get
-
indexOf
-
indexOf
-
copyInto
-
trimToSize
public void trimToSize()- Overrides:
trimToSize
in classVector
-
ensureCapacity
public void ensureCapacity(int minCapacity) - Overrides:
ensureCapacity
in classVector
-
capacity
public int capacity() -
elements
-
lastIndexOf
- Overrides:
lastIndexOf
in classVector
-
elementAt
-
firstElement
- Overrides:
firstElement
in classVector
-
lastElement
- Overrides:
lastElement
in classVector
-
toString
-
removeRange
protected void removeRange(int fromIndex, int toIndex) - Overrides:
removeRange
in classVector
-