Package org.apache.openjpa.util.proxy
Class DelayedLinkedListProxy
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.AbstractSequentialList<E>
-
- java.util.LinkedList
-
- org.apache.openjpa.util.proxy.DelayedLinkedListProxy
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable
,java.util.Collection
,java.util.Deque
,java.util.List
,java.util.Queue
,Proxy
,DelayedProxy
,ProxyCollection
public class DelayedLinkedListProxy extends java.util.LinkedList implements ProxyCollection, DelayedProxy
LinkedList 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
-
-
Constructor Summary
Constructors Constructor Description DelayedLinkedListProxy()
DelayedLinkedListProxy(java.util.Collection paramCollection)
-
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
addFirst(java.lang.Object paramObject)
void
addLast(java.lang.Object paramObject)
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 c)
java.lang.Object
copy(java.lang.Object paramObject)
Return an unproxied copy of the given instance.java.util.Iterator
descendingIterator()
java.lang.Object
element()
boolean
equals(java.lang.Object paramObject)
java.lang.Object
get(int index)
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.java.lang.Object
getFirst()
java.lang.Object
getLast()
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 o)
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()
int
lastIndexOf(java.lang.Object o)
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.boolean
offer(java.lang.Object paramObject)
boolean
offerFirst(java.lang.Object paramObject)
boolean
offerLast(java.lang.Object paramObject)
java.lang.Object
peek()
java.lang.Object
peekFirst()
java.lang.Object
peekLast()
java.lang.Object
poll()
java.lang.Object
pollFirst()
java.lang.Object
pollLast()
java.lang.Object
pop()
void
push(java.lang.Object o)
java.lang.Object
remove()
java.lang.Object
remove(int paramInt)
boolean
remove(java.lang.Object paramObject)
boolean
removeAll(java.util.Collection paramCollection)
java.lang.Object
removeFirst()
boolean
removeFirstOccurrence(java.lang.Object paramObject)
java.lang.Object
removeLast()
boolean
removeLastOccurrence(java.lang.Object paramObject)
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.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.int
size()
java.util.List
subList(int fromIndex, int toIndex)
java.lang.Object[]
toArray()
java.lang.Object[]
toArray(java.lang.Object[] array)
java.lang.Object[]
toArray(java.util.function.IntFunction generator)
protected java.lang.Object
writeReplace()
-
-
-
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.
-
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
-
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 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.
-
getElementType
public java.lang.Class getElementType()
Description copied from interface:ProxyCollection
The collection element type.- Specified by:
getElementType
in interfaceProxyCollection
-
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 interfaceProxyCollection
-
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
-
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()
-
clone
public java.lang.Object clone()
- Overrides:
clone
in classjava.util.LinkedList
-
add
public void add(int paramInt, java.lang.Object paramObject)
- Specified by:
add
in interfacejava.util.List
- Overrides:
add
in classjava.util.LinkedList
-
add
public boolean add(java.lang.Object paramObject)
- Specified by:
add
in interfacejava.util.Collection
- Specified by:
add
in interfacejava.util.Deque
- Specified by:
add
in interfacejava.util.List
- Specified by:
add
in interfacejava.util.Queue
- Overrides:
add
in classjava.util.LinkedList
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Collection
- Specified by:
clear
in interfacejava.util.List
- Overrides:
clear
in classjava.util.LinkedList
-
addAll
public boolean addAll(java.util.Collection paramCollection)
- Specified by:
addAll
in interfacejava.util.Collection
- Specified by:
addAll
in interfacejava.util.Deque
- Specified by:
addAll
in interfacejava.util.List
- Overrides:
addAll
in classjava.util.LinkedList
-
addAll
public boolean addAll(int paramInt, java.util.Collection paramCollection)
- Specified by:
addAll
in interfacejava.util.List
- Overrides:
addAll
in classjava.util.LinkedList
-
remove
public boolean remove(java.lang.Object paramObject)
- Specified by:
remove
in interfacejava.util.Collection
- Specified by:
remove
in interfacejava.util.Deque
- Specified by:
remove
in interfacejava.util.List
- Overrides:
remove
in classjava.util.LinkedList
-
remove
public java.lang.Object remove(int paramInt)
- Specified by:
remove
in interfacejava.util.List
- Overrides:
remove
in classjava.util.LinkedList
-
remove
public java.lang.Object remove()
- Specified by:
remove
in interfacejava.util.Deque
- Specified by:
remove
in interfacejava.util.Queue
- Overrides:
remove
in classjava.util.LinkedList
-
set
public java.lang.Object set(int paramInt, java.lang.Object paramObject)
- Specified by:
set
in interfacejava.util.List
- Overrides:
set
in classjava.util.LinkedList
-
poll
public java.lang.Object poll()
- Specified by:
poll
in interfacejava.util.Deque
- Specified by:
poll
in interfacejava.util.Queue
- Overrides:
poll
in classjava.util.LinkedList
-
listIterator
public java.util.ListIterator listIterator(int paramInt)
- Specified by:
listIterator
in interfacejava.util.List
- Overrides:
listIterator
in classjava.util.LinkedList
-
addFirst
public void addFirst(java.lang.Object paramObject)
- Specified by:
addFirst
in interfacejava.util.Deque
- Overrides:
addFirst
in classjava.util.LinkedList
-
addLast
public void addLast(java.lang.Object paramObject)
- Specified by:
addLast
in interfacejava.util.Deque
- Overrides:
addLast
in classjava.util.LinkedList
-
offer
public boolean offer(java.lang.Object paramObject)
- Specified by:
offer
in interfacejava.util.Deque
- Specified by:
offer
in interfacejava.util.Queue
- Overrides:
offer
in classjava.util.LinkedList
-
removeFirst
public java.lang.Object removeFirst()
- Specified by:
removeFirst
in interfacejava.util.Deque
- Overrides:
removeFirst
in classjava.util.LinkedList
-
removeLast
public java.lang.Object removeLast()
- Specified by:
removeLast
in interfacejava.util.Deque
- Overrides:
removeLast
in classjava.util.LinkedList
-
iterator
public java.util.Iterator iterator()
- Specified by:
iterator
in interfacejava.util.Collection
- Specified by:
iterator
in interfacejava.util.Deque
- Specified by:
iterator
in interfacejava.lang.Iterable
- Specified by:
iterator
in interfacejava.util.List
- Overrides:
iterator
in classjava.util.AbstractSequentialList
-
listIterator
public java.util.ListIterator listIterator()
- Specified by:
listIterator
in interfacejava.util.List
- Overrides:
listIterator
in classjava.util.AbstractList
-
removeAll
public boolean removeAll(java.util.Collection paramCollection)
- Specified by:
removeAll
in interfacejava.util.Collection
- Specified by:
removeAll
in interfacejava.util.List
- Overrides:
removeAll
in classjava.util.AbstractCollection
-
retainAll
public boolean retainAll(java.util.Collection paramCollection)
- Specified by:
retainAll
in interfacejava.util.Collection
- Specified by:
retainAll
in interfacejava.util.List
- Overrides:
retainAll
in classjava.util.AbstractCollection
-
removeFirstOccurrence
public boolean removeFirstOccurrence(java.lang.Object paramObject)
- Specified by:
removeFirstOccurrence
in interfacejava.util.Deque
- Overrides:
removeFirstOccurrence
in classjava.util.LinkedList
-
removeLastOccurrence
public boolean removeLastOccurrence(java.lang.Object paramObject)
- Specified by:
removeLastOccurrence
in interfacejava.util.Deque
- Overrides:
removeLastOccurrence
in classjava.util.LinkedList
-
writeReplace
protected java.lang.Object writeReplace() throws java.io.ObjectStreamException
- Throws:
java.io.ObjectStreamException
-
equals
public boolean equals(java.lang.Object paramObject)
- Specified by:
equals
in interfacejava.util.Collection
- Specified by:
equals
in interfacejava.util.List
- Overrides:
equals
in classjava.util.AbstractList
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfacejava.util.Collection
- Specified by:
hashCode
in interfacejava.util.List
- Overrides:
hashCode
in classjava.util.AbstractList
-
subList
public java.util.List subList(int fromIndex, int toIndex)
- Specified by:
subList
in interfacejava.util.List
- Overrides:
subList
in classjava.util.AbstractList
-
lastIndexOf
public int lastIndexOf(java.lang.Object o)
- Specified by:
lastIndexOf
in interfacejava.util.List
- Overrides:
lastIndexOf
in classjava.util.LinkedList
-
indexOf
public int indexOf(java.lang.Object o)
- Specified by:
indexOf
in interfacejava.util.List
- Overrides:
indexOf
in classjava.util.LinkedList
-
get
public java.lang.Object get(int index)
- Specified by:
get
in interfacejava.util.List
- Overrides:
get
in classjava.util.LinkedList
-
containsAll
public boolean containsAll(java.util.Collection c)
- Specified by:
containsAll
in interfacejava.util.Collection
- Specified by:
containsAll
in interfacejava.util.List
- Overrides:
containsAll
in classjava.util.AbstractCollection
-
toArray
public java.lang.Object[] toArray()
- Specified by:
toArray
in interfacejava.util.Collection
- Specified by:
toArray
in interfacejava.util.List
- Overrides:
toArray
in classjava.util.LinkedList
-
toArray
public java.lang.Object[] toArray(java.lang.Object[] array)
- Specified by:
toArray
in interfacejava.util.Collection
- Specified by:
toArray
in interfacejava.util.List
- Overrides:
toArray
in classjava.util.LinkedList
-
toArray
public java.lang.Object[] toArray(java.util.function.IntFunction generator)
- Specified by:
toArray
in interfacejava.util.Collection
-
contains
public boolean contains(java.lang.Object object)
- Specified by:
contains
in interfacejava.util.Collection
- Specified by:
contains
in interfacejava.util.Deque
- Specified by:
contains
in interfacejava.util.List
- Overrides:
contains
in classjava.util.LinkedList
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfacejava.util.Collection
- Specified by:
isEmpty
in interfacejava.util.List
- Overrides:
isEmpty
in classjava.util.AbstractCollection
-
size
public int size()
- Specified by:
size
in interfacejava.util.Collection
- Specified by:
size
in interfacejava.util.Deque
- Specified by:
size
in interfacejava.util.List
- Overrides:
size
in classjava.util.LinkedList
-
offerFirst
public boolean offerFirst(java.lang.Object paramObject)
- Specified by:
offerFirst
in interfacejava.util.Deque
- Overrides:
offerFirst
in classjava.util.LinkedList
-
offerLast
public boolean offerLast(java.lang.Object paramObject)
- Specified by:
offerLast
in interfacejava.util.Deque
- Overrides:
offerLast
in classjava.util.LinkedList
-
pollFirst
public java.lang.Object pollFirst()
- Specified by:
pollFirst
in interfacejava.util.Deque
- Overrides:
pollFirst
in classjava.util.LinkedList
-
pollLast
public java.lang.Object pollLast()
- Specified by:
pollLast
in interfacejava.util.Deque
- Overrides:
pollLast
in classjava.util.LinkedList
-
getFirst
public java.lang.Object getFirst()
- Specified by:
getFirst
in interfacejava.util.Deque
- Overrides:
getFirst
in classjava.util.LinkedList
-
getLast
public java.lang.Object getLast()
- Specified by:
getLast
in interfacejava.util.Deque
- Overrides:
getLast
in classjava.util.LinkedList
-
peekFirst
public java.lang.Object peekFirst()
- Specified by:
peekFirst
in interfacejava.util.Deque
- Overrides:
peekFirst
in classjava.util.LinkedList
-
peekLast
public java.lang.Object peekLast()
- Specified by:
peekLast
in interfacejava.util.Deque
- Overrides:
peekLast
in classjava.util.LinkedList
-
element
public java.lang.Object element()
- Specified by:
element
in interfacejava.util.Deque
- Specified by:
element
in interfacejava.util.Queue
- Overrides:
element
in classjava.util.LinkedList
-
peek
public java.lang.Object peek()
- Specified by:
peek
in interfacejava.util.Deque
- Specified by:
peek
in interfacejava.util.Queue
- Overrides:
peek
in classjava.util.LinkedList
-
push
public void push(java.lang.Object o)
- Specified by:
push
in interfacejava.util.Deque
- Overrides:
push
in classjava.util.LinkedList
-
pop
public java.lang.Object pop()
- Specified by:
pop
in interfacejava.util.Deque
- Overrides:
pop
in classjava.util.LinkedList
-
descendingIterator
public java.util.Iterator descendingIterator()
- Specified by:
descendingIterator
in interfacejava.util.Deque
- Overrides:
descendingIterator
in classjava.util.LinkedList
-
-