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:
Serializable,Cloneable,Iterable,Collection,Deque,List,Queue,Proxy,DelayedProxy,ProxyCollection
public class DelayedLinkedListProxy extends 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
-
-
Field Summary
-
Fields inherited from class java.util.AbstractList
modCount
-
-
Constructor Summary
Constructors Constructor Description DelayedLinkedListProxy()DelayedLinkedListProxy(Collection paramCollection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(int paramInt, Object paramObject)booleanadd(Object paramObject)booleanaddAll(int paramInt, Collection paramCollection)booleanaddAll(Collection paramCollection)voidaddFirst(Object paramObject)voidaddLast(Object paramObject)voidclear()Objectclone()voidcloseBroker()Close the broker that is used to service this proxy.booleancontains(Object object)booleancontainsAll(Collection c)Objectcopy(Object paramObject)Return an unproxied copy of the given instance.IteratordescendingIterator()Objectelement()booleanequals(Object paramObject)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.ClassgetElementType()The collection element type.ObjectgetFirst()ObjectgetLast()OpenJPAStateManagergetOwner()Return the owning object.intgetOwnerField()Return the owning field index.OpenJPAStateManagergetOwnerStateManager()Returns the state manager of the owning instance.inthashCode()intindexOf(Object o)booleanisDelayLoad()booleanisDetached()Returns whether the proxy is detached.booleanisDirectAccess()Returns whether the caller has direct-call access to the proxied object.booleanisEmpty()Iteratoriterator()intlastIndexOf(Object o)ListIteratorlistIterator()ListIteratorlistIterator(int paramInt)voidload()Load the proxy if it was delay-loaded.ProxyCollectionnewInstance(Class paramClass, Comparator paramComparator, boolean paramBoolean1, boolean paramBoolean2)Create a new instance of this proxy type.booleanoffer(Object paramObject)booleanofferFirst(Object paramObject)booleanofferLast(Object paramObject)Objectpeek()ObjectpeekFirst()ObjectpeekLast()Objectpoll()ObjectpollFirst()ObjectpollLast()Objectpop()voidpush(Object o)Objectremove()Objectremove(int paramInt)booleanremove(Object paramObject)booleanremoveAll(Collection paramCollection)ObjectremoveFirst()booleanremoveFirstOccurrence(Object paramObject)ObjectremoveLast()booleanremoveLastOccurrence(Object paramObject)booleanretainAll(Collection paramCollection)Objectset(int paramInt, Object paramObject)protected voidsetChangeTracker(CollectionChangeTracker ct)voidsetDirectAccess(boolean direct)Sets whether the caller has direct-call access to the proxied object.protected voidsetElementType(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()ListsubList(int fromIndex, int toIndex)Object[]toArray()Object[]toArray(Object[] array)Object[]toArray(IntFunction generator)protected ObjectwriteReplace()-
Methods inherited from class java.util.LinkedList
spliterator
-
Methods inherited from class java.util.AbstractList
removeRange
-
Methods inherited from class java.util.AbstractCollection
toString
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream
-
Methods inherited from interface java.util.List
replaceAll, sort
-
-
-
-
Constructor Detail
-
DelayedLinkedListProxy
public DelayedLinkedListProxy(Collection paramCollection)
-
DelayedLinkedListProxy
public DelayedLinkedListProxy()
-
-
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 Object copy(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 Class getElementType()
Description copied from interface:ProxyCollectionThe collection element type.- Specified by:
getElementTypein interfaceProxyCollection
-
setElementType
protected void setElementType(Class<?> elemType)
-
newInstance
public ProxyCollection newInstance(Class paramClass, 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 Object clone()
- Overrides:
clonein classLinkedList
-
add
public void add(int paramInt, Object paramObject)- Specified by:
addin interfaceList- Overrides:
addin classLinkedList
-
add
public boolean add(Object paramObject)
- Specified by:
addin interfaceCollection- Specified by:
addin interfaceDeque- Specified by:
addin interfaceList- Specified by:
addin interfaceQueue- Overrides:
addin classLinkedList
-
clear
public void clear()
- Specified by:
clearin interfaceCollection- Specified by:
clearin interfaceList- Overrides:
clearin classLinkedList
-
addAll
public boolean addAll(Collection paramCollection)
- Specified by:
addAllin interfaceCollection- Specified by:
addAllin interfaceDeque- Specified by:
addAllin interfaceList- Overrides:
addAllin classLinkedList
-
addAll
public boolean addAll(int paramInt, Collection paramCollection)- Specified by:
addAllin interfaceList- Overrides:
addAllin classLinkedList
-
remove
public boolean remove(Object paramObject)
- Specified by:
removein interfaceCollection- Specified by:
removein interfaceDeque- Specified by:
removein interfaceList- Overrides:
removein classLinkedList
-
remove
public Object remove(int paramInt)
- Specified by:
removein interfaceList- Overrides:
removein classLinkedList
-
remove
public Object remove()
-
set
public Object set(int paramInt, Object paramObject)
- Specified by:
setin interfaceList- Overrides:
setin classLinkedList
-
poll
public Object poll()
-
listIterator
public ListIterator listIterator(int paramInt)
- Specified by:
listIteratorin interfaceList- Overrides:
listIteratorin classLinkedList
-
addFirst
public void addFirst(Object paramObject)
- Specified by:
addFirstin interfaceDeque- Overrides:
addFirstin classLinkedList
-
addLast
public void addLast(Object paramObject)
- Specified by:
addLastin interfaceDeque- Overrides:
addLastin classLinkedList
-
offer
public boolean offer(Object paramObject)
-
removeFirst
public Object removeFirst()
- Specified by:
removeFirstin interfaceDeque- Overrides:
removeFirstin classLinkedList
-
removeLast
public Object removeLast()
- Specified by:
removeLastin interfaceDeque- Overrides:
removeLastin classLinkedList
-
iterator
public Iterator iterator()
- Specified by:
iteratorin interfaceCollection- Specified by:
iteratorin interfaceDeque- Specified by:
iteratorin interfaceIterable- Specified by:
iteratorin interfaceList- Overrides:
iteratorin classAbstractSequentialList
-
listIterator
public ListIterator listIterator()
- Specified by:
listIteratorin interfaceList- Overrides:
listIteratorin classAbstractList
-
removeAll
public boolean removeAll(Collection paramCollection)
- Specified by:
removeAllin interfaceCollection- Specified by:
removeAllin interfaceList- Overrides:
removeAllin classAbstractCollection
-
retainAll
public boolean retainAll(Collection paramCollection)
- Specified by:
retainAllin interfaceCollection- Specified by:
retainAllin interfaceList- Overrides:
retainAllin classAbstractCollection
-
removeFirstOccurrence
public boolean removeFirstOccurrence(Object paramObject)
- Specified by:
removeFirstOccurrencein interfaceDeque- Overrides:
removeFirstOccurrencein classLinkedList
-
removeLastOccurrence
public boolean removeLastOccurrence(Object paramObject)
- Specified by:
removeLastOccurrencein interfaceDeque- Overrides:
removeLastOccurrencein classLinkedList
-
writeReplace
protected Object writeReplace() throws ObjectStreamException
- Throws:
ObjectStreamException
-
equals
public boolean equals(Object paramObject)
- Specified by:
equalsin interfaceCollection- Specified by:
equalsin interfaceList- Overrides:
equalsin classAbstractList
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfaceCollection- Specified by:
hashCodein interfaceList- Overrides:
hashCodein classAbstractList
-
subList
public List subList(int fromIndex, int toIndex)
- Specified by:
subListin interfaceList- Overrides:
subListin classAbstractList
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOfin interfaceList- Overrides:
lastIndexOfin classLinkedList
-
indexOf
public int indexOf(Object o)
- Specified by:
indexOfin interfaceList- Overrides:
indexOfin classLinkedList
-
get
public Object get(int index)
- Specified by:
getin interfaceList- Overrides:
getin classLinkedList
-
containsAll
public boolean containsAll(Collection c)
- Specified by:
containsAllin interfaceCollection- Specified by:
containsAllin interfaceList- Overrides:
containsAllin classAbstractCollection
-
toArray
public Object[] toArray()
- Specified by:
toArrayin interfaceCollection- Specified by:
toArrayin interfaceList- Overrides:
toArrayin classLinkedList
-
toArray
public Object[] toArray(Object[] array)
- Specified by:
toArrayin interfaceCollection- Specified by:
toArrayin interfaceList- Overrides:
toArrayin classLinkedList
-
toArray
public Object[] toArray(IntFunction generator)
- Specified by:
toArrayin interfaceCollection
-
contains
public boolean contains(Object object)
- Specified by:
containsin interfaceCollection- Specified by:
containsin interfaceDeque- Specified by:
containsin interfaceList- Overrides:
containsin classLinkedList
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceCollection- Specified by:
isEmptyin interfaceList- Overrides:
isEmptyin classAbstractCollection
-
size
public int size()
- Specified by:
sizein interfaceCollection- Specified by:
sizein interfaceDeque- Specified by:
sizein interfaceList- Overrides:
sizein classLinkedList
-
offerFirst
public boolean offerFirst(Object paramObject)
- Specified by:
offerFirstin interfaceDeque- Overrides:
offerFirstin classLinkedList
-
offerLast
public boolean offerLast(Object paramObject)
- Specified by:
offerLastin interfaceDeque- Overrides:
offerLastin classLinkedList
-
pollFirst
public Object pollFirst()
- Specified by:
pollFirstin interfaceDeque- Overrides:
pollFirstin classLinkedList
-
pollLast
public Object pollLast()
- Specified by:
pollLastin interfaceDeque- Overrides:
pollLastin classLinkedList
-
getFirst
public Object getFirst()
- Specified by:
getFirstin interfaceDeque- Overrides:
getFirstin classLinkedList
-
getLast
public Object getLast()
- Specified by:
getLastin interfaceDeque- Overrides:
getLastin classLinkedList
-
peekFirst
public Object peekFirst()
- Specified by:
peekFirstin interfaceDeque- Overrides:
peekFirstin classLinkedList
-
peekLast
public Object peekLast()
- Specified by:
peekLastin interfaceDeque- Overrides:
peekLastin classLinkedList
-
element
public Object element()
-
peek
public Object peek()
-
push
public void push(Object o)
- Specified by:
pushin interfaceDeque- Overrides:
pushin classLinkedList
-
pop
public Object pop()
- Specified by:
popin interfaceDeque- Overrides:
popin classLinkedList
-
descendingIterator
public Iterator descendingIterator()
- Specified by:
descendingIteratorin interfaceDeque- Overrides:
descendingIteratorin classLinkedList
-
-