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 voidadd(int paramInt, java.lang.Object paramObject)booleanadd(java.lang.Object paramObject)booleanaddAll(int paramInt, java.util.Collection paramCollection)booleanaddAll(java.util.Collection paramCollection)voidaddFirst(java.lang.Object paramObject)voidaddLast(java.lang.Object paramObject)voidclear()java.lang.Objectclone()voidcloseBroker()Close the broker that is used to service this proxy.booleancontains(java.lang.Object object)booleancontainsAll(java.util.Collection c)java.lang.Objectcopy(java.lang.Object paramObject)Return an unproxied copy of the given instance.java.util.IteratordescendingIterator()java.lang.Objectelement()booleanequals(java.lang.Object paramObject)java.lang.Objectget(int index)BrokergetBroker()Get the broker that is used to service this proxy.BrokerFactorygetBrokerFactory()ChangeTrackergetChangeTracker()Return the change tracker for this proxy, or null if none.intgetDelayedField()Returns the expected field index even if this collection was detached.OpenJPAStateManagergetDelayedOwner()Returns a state manager that can service this proxy even if the collection was detached.java.lang.ClassgetElementType()The collection element type.java.lang.ObjectgetFirst()java.lang.ObjectgetLast()OpenJPAStateManagergetOwner()Return the owning object.intgetOwnerField()Return the owning field index.OpenJPAStateManagergetOwnerStateManager()Returns the state manager of the owning instance.inthashCode()intindexOf(java.lang.Object o)booleanisDelayLoad()booleanisDetached()Returns whether the proxy is detached.booleanisDirectAccess()Returns whether the caller has direct-call access to the proxied object.booleanisEmpty()java.util.Iteratoriterator()intlastIndexOf(java.lang.Object o)java.util.ListIteratorlistIterator()java.util.ListIteratorlistIterator(int paramInt)voidload()Load the proxy if it was delay-loaded.ProxyCollectionnewInstance(java.lang.Class paramClass, java.util.Comparator paramComparator, boolean paramBoolean1, boolean paramBoolean2)Create a new instance of this proxy type.booleanoffer(java.lang.Object paramObject)booleanofferFirst(java.lang.Object paramObject)booleanofferLast(java.lang.Object paramObject)java.lang.Objectpeek()java.lang.ObjectpeekFirst()java.lang.ObjectpeekLast()java.lang.Objectpoll()java.lang.ObjectpollFirst()java.lang.ObjectpollLast()java.lang.Objectpop()voidpush(java.lang.Object o)java.lang.Objectremove()java.lang.Objectremove(int paramInt)booleanremove(java.lang.Object paramObject)booleanremoveAll(java.util.Collection paramCollection)java.lang.ObjectremoveFirst()booleanremoveFirstOccurrence(java.lang.Object paramObject)java.lang.ObjectremoveLast()booleanremoveLastOccurrence(java.lang.Object paramObject)booleanretainAll(java.util.Collection paramCollection)java.lang.Objectset(int paramInt, java.lang.Object paramObject)protected voidsetChangeTracker(CollectionChangeTracker ct)voidsetDirectAccess(boolean direct)Sets whether the caller has direct-call access to the proxied object.protected voidsetElementType(java.lang.Class<?> elemType)voidsetOwner(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.intsize()java.util.ListsubList(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.ObjectwriteReplace()
-
-
-
Method Detail
-
setOwner
public void setOwner(OpenJPAStateManager paramOpenJPAStateManager, int paramInt)
Description copied from interface:ProxyReset 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:ProxyReturn the owning object.
-
getOwnerField
public int getOwnerField()
Description copied from interface:ProxyReturn the owning field index.- Specified by:
getOwnerFieldin interfaceProxy
-
getChangeTracker
public ChangeTracker getChangeTracker()
Description copied from interface:ProxyReturn the change tracker for this proxy, or null if none.- Specified by:
getChangeTrackerin interfaceProxy
-
setChangeTracker
protected void setChangeTracker(CollectionChangeTracker ct)
-
copy
public java.lang.Object copy(java.lang.Object paramObject)
Description copied from interface:ProxyReturn 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:ProxyCollectionThe collection element type.- Specified by:
getElementTypein 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:ProxyCollectionCreate a new instance of this proxy type.- Specified by:
newInstancein interfaceProxyCollection
-
getDelayedField
public int getDelayedField()
Description copied from interface:DelayedProxyReturns the expected field index even if this collection was detached.- Specified by:
getDelayedFieldin interfaceDelayedProxy
-
getDelayedOwner
public OpenJPAStateManager getDelayedOwner()
Description copied from interface:DelayedProxyReturns a state manager that can service this proxy even if the collection was detached.- Specified by:
getDelayedOwnerin interfaceDelayedProxy
-
isDirectAccess
public boolean isDirectAccess()
Description copied from interface:DelayedProxyReturns 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:
isDirectAccessin interfaceDelayedProxy
-
setDirectAccess
public void setDirectAccess(boolean direct)
Description copied from interface:DelayedProxySets 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:
setDirectAccessin interfaceDelayedProxy
-
getBrokerFactory
public BrokerFactory getBrokerFactory()
-
load
public void load()
Description copied from interface:DelayedProxyLoad the proxy if it was delay-loaded.- Specified by:
loadin interfaceDelayedProxy
-
getBroker
public Broker getBroker()
Description copied from interface:DelayedProxyGet the broker that is used to service this proxy.- Specified by:
getBrokerin interfaceDelayedProxy
-
closeBroker
public void closeBroker()
Description copied from interface:DelayedProxyClose the broker that is used to service this proxy.- Specified by:
closeBrokerin interfaceDelayedProxy
-
getOwnerStateManager
public OpenJPAStateManager getOwnerStateManager()
Description copied from interface:DelayedProxyReturns the state manager of the owning instance.- Specified by:
getOwnerStateManagerin interfaceDelayedProxy
-
isDetached
public boolean isDetached()
Description copied from interface:DelayedProxyReturns whether the proxy is detached.- Specified by:
isDetachedin interfaceDelayedProxy
-
isDelayLoad
public boolean isDelayLoad()
-
clone
public java.lang.Object clone()
- Overrides:
clonein classjava.util.LinkedList
-
add
public void add(int paramInt, java.lang.Object paramObject)- Specified by:
addin interfacejava.util.List- Overrides:
addin classjava.util.LinkedList
-
add
public boolean add(java.lang.Object paramObject)
- Specified by:
addin interfacejava.util.Collection- Specified by:
addin interfacejava.util.Deque- Specified by:
addin interfacejava.util.List- Specified by:
addin interfacejava.util.Queue- Overrides:
addin classjava.util.LinkedList
-
clear
public void clear()
- Specified by:
clearin interfacejava.util.Collection- Specified by:
clearin interfacejava.util.List- Overrides:
clearin classjava.util.LinkedList
-
addAll
public boolean addAll(java.util.Collection paramCollection)
- Specified by:
addAllin interfacejava.util.Collection- Specified by:
addAllin interfacejava.util.Deque- Specified by:
addAllin interfacejava.util.List- Overrides:
addAllin classjava.util.LinkedList
-
addAll
public boolean addAll(int paramInt, java.util.Collection paramCollection)- Specified by:
addAllin interfacejava.util.List- Overrides:
addAllin classjava.util.LinkedList
-
remove
public boolean remove(java.lang.Object paramObject)
- Specified by:
removein interfacejava.util.Collection- Specified by:
removein interfacejava.util.Deque- Specified by:
removein interfacejava.util.List- Overrides:
removein classjava.util.LinkedList
-
remove
public java.lang.Object remove(int paramInt)
- Specified by:
removein interfacejava.util.List- Overrides:
removein classjava.util.LinkedList
-
remove
public java.lang.Object remove()
- Specified by:
removein interfacejava.util.Deque- Specified by:
removein interfacejava.util.Queue- Overrides:
removein classjava.util.LinkedList
-
set
public java.lang.Object set(int paramInt, java.lang.Object paramObject)- Specified by:
setin interfacejava.util.List- Overrides:
setin classjava.util.LinkedList
-
poll
public java.lang.Object poll()
- Specified by:
pollin interfacejava.util.Deque- Specified by:
pollin interfacejava.util.Queue- Overrides:
pollin classjava.util.LinkedList
-
listIterator
public java.util.ListIterator listIterator(int paramInt)
- Specified by:
listIteratorin interfacejava.util.List- Overrides:
listIteratorin classjava.util.LinkedList
-
addFirst
public void addFirst(java.lang.Object paramObject)
- Specified by:
addFirstin interfacejava.util.Deque- Overrides:
addFirstin classjava.util.LinkedList
-
addLast
public void addLast(java.lang.Object paramObject)
- Specified by:
addLastin interfacejava.util.Deque- Overrides:
addLastin classjava.util.LinkedList
-
offer
public boolean offer(java.lang.Object paramObject)
- Specified by:
offerin interfacejava.util.Deque- Specified by:
offerin interfacejava.util.Queue- Overrides:
offerin classjava.util.LinkedList
-
removeFirst
public java.lang.Object removeFirst()
- Specified by:
removeFirstin interfacejava.util.Deque- Overrides:
removeFirstin classjava.util.LinkedList
-
removeLast
public java.lang.Object removeLast()
- Specified by:
removeLastin interfacejava.util.Deque- Overrides:
removeLastin classjava.util.LinkedList
-
iterator
public java.util.Iterator iterator()
- Specified by:
iteratorin interfacejava.util.Collection- Specified by:
iteratorin interfacejava.util.Deque- Specified by:
iteratorin interfacejava.lang.Iterable- Specified by:
iteratorin interfacejava.util.List- Overrides:
iteratorin classjava.util.AbstractSequentialList
-
listIterator
public java.util.ListIterator listIterator()
- Specified by:
listIteratorin interfacejava.util.List- Overrides:
listIteratorin classjava.util.AbstractList
-
removeAll
public boolean removeAll(java.util.Collection paramCollection)
- Specified by:
removeAllin interfacejava.util.Collection- Specified by:
removeAllin interfacejava.util.List- Overrides:
removeAllin classjava.util.AbstractCollection
-
retainAll
public boolean retainAll(java.util.Collection paramCollection)
- Specified by:
retainAllin interfacejava.util.Collection- Specified by:
retainAllin interfacejava.util.List- Overrides:
retainAllin classjava.util.AbstractCollection
-
removeFirstOccurrence
public boolean removeFirstOccurrence(java.lang.Object paramObject)
- Specified by:
removeFirstOccurrencein interfacejava.util.Deque- Overrides:
removeFirstOccurrencein classjava.util.LinkedList
-
removeLastOccurrence
public boolean removeLastOccurrence(java.lang.Object paramObject)
- Specified by:
removeLastOccurrencein interfacejava.util.Deque- Overrides:
removeLastOccurrencein 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:
equalsin interfacejava.util.Collection- Specified by:
equalsin interfacejava.util.List- Overrides:
equalsin classjava.util.AbstractList
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfacejava.util.Collection- Specified by:
hashCodein interfacejava.util.List- Overrides:
hashCodein classjava.util.AbstractList
-
subList
public java.util.List subList(int fromIndex, int toIndex)- Specified by:
subListin interfacejava.util.List- Overrides:
subListin classjava.util.AbstractList
-
lastIndexOf
public int lastIndexOf(java.lang.Object o)
- Specified by:
lastIndexOfin interfacejava.util.List- Overrides:
lastIndexOfin classjava.util.LinkedList
-
indexOf
public int indexOf(java.lang.Object o)
- Specified by:
indexOfin interfacejava.util.List- Overrides:
indexOfin classjava.util.LinkedList
-
get
public java.lang.Object get(int index)
- Specified by:
getin interfacejava.util.List- Overrides:
getin classjava.util.LinkedList
-
containsAll
public boolean containsAll(java.util.Collection c)
- Specified by:
containsAllin interfacejava.util.Collection- Specified by:
containsAllin interfacejava.util.List- Overrides:
containsAllin classjava.util.AbstractCollection
-
toArray
public java.lang.Object[] toArray()
- Specified by:
toArrayin interfacejava.util.Collection- Specified by:
toArrayin interfacejava.util.List- Overrides:
toArrayin classjava.util.LinkedList
-
toArray
public java.lang.Object[] toArray(java.lang.Object[] array)
- Specified by:
toArrayin interfacejava.util.Collection- Specified by:
toArrayin interfacejava.util.List- Overrides:
toArrayin classjava.util.LinkedList
-
toArray
public java.lang.Object[] toArray(java.util.function.IntFunction generator)
- Specified by:
toArrayin interfacejava.util.Collection
-
contains
public boolean contains(java.lang.Object object)
- Specified by:
containsin interfacejava.util.Collection- Specified by:
containsin interfacejava.util.Deque- Specified by:
containsin interfacejava.util.List- Overrides:
containsin classjava.util.LinkedList
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfacejava.util.Collection- Specified by:
isEmptyin interfacejava.util.List- Overrides:
isEmptyin classjava.util.AbstractCollection
-
size
public int size()
- Specified by:
sizein interfacejava.util.Collection- Specified by:
sizein interfacejava.util.Deque- Specified by:
sizein interfacejava.util.List- Overrides:
sizein classjava.util.LinkedList
-
offerFirst
public boolean offerFirst(java.lang.Object paramObject)
- Specified by:
offerFirstin interfacejava.util.Deque- Overrides:
offerFirstin classjava.util.LinkedList
-
offerLast
public boolean offerLast(java.lang.Object paramObject)
- Specified by:
offerLastin interfacejava.util.Deque- Overrides:
offerLastin classjava.util.LinkedList
-
pollFirst
public java.lang.Object pollFirst()
- Specified by:
pollFirstin interfacejava.util.Deque- Overrides:
pollFirstin classjava.util.LinkedList
-
pollLast
public java.lang.Object pollLast()
- Specified by:
pollLastin interfacejava.util.Deque- Overrides:
pollLastin classjava.util.LinkedList
-
getFirst
public java.lang.Object getFirst()
- Specified by:
getFirstin interfacejava.util.Deque- Overrides:
getFirstin classjava.util.LinkedList
-
getLast
public java.lang.Object getLast()
- Specified by:
getLastin interfacejava.util.Deque- Overrides:
getLastin classjava.util.LinkedList
-
peekFirst
public java.lang.Object peekFirst()
- Specified by:
peekFirstin interfacejava.util.Deque- Overrides:
peekFirstin classjava.util.LinkedList
-
peekLast
public java.lang.Object peekLast()
- Specified by:
peekLastin interfacejava.util.Deque- Overrides:
peekLastin classjava.util.LinkedList
-
element
public java.lang.Object element()
- Specified by:
elementin interfacejava.util.Deque- Specified by:
elementin interfacejava.util.Queue- Overrides:
elementin classjava.util.LinkedList
-
peek
public java.lang.Object peek()
- Specified by:
peekin interfacejava.util.Deque- Specified by:
peekin interfacejava.util.Queue- Overrides:
peekin classjava.util.LinkedList
-
push
public void push(java.lang.Object o)
- Specified by:
pushin interfacejava.util.Deque- Overrides:
pushin classjava.util.LinkedList
-
pop
public java.lang.Object pop()
- Specified by:
popin interfacejava.util.Deque- Overrides:
popin classjava.util.LinkedList
-
descendingIterator
public java.util.Iterator descendingIterator()
- Specified by:
descendingIteratorin interfacejava.util.Deque- Overrides:
descendingIteratorin classjava.util.LinkedList
-
-