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 void
add(int paramInt, Object paramObject)
boolean
add(Object paramObject)
boolean
addAll(int paramInt, Collection paramCollection)
boolean
addAll(Collection paramCollection)
void
addFirst(Object paramObject)
void
addLast(Object paramObject)
void
clear()
Object
clone()
void
closeBroker()
Close the broker that is used to service this proxy.boolean
contains(Object object)
boolean
containsAll(Collection c)
Object
copy(Object paramObject)
Return an unproxied copy of the given instance.Iterator
descendingIterator()
Object
element()
boolean
equals(Object paramObject)
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.Class
getElementType()
The collection element type.Object
getFirst()
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(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()
Iterator
iterator()
int
lastIndexOf(Object o)
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.boolean
offer(Object paramObject)
boolean
offerFirst(Object paramObject)
boolean
offerLast(Object paramObject)
Object
peek()
Object
peekFirst()
Object
peekLast()
Object
poll()
Object
pollFirst()
Object
pollLast()
Object
pop()
void
push(Object o)
Object
remove()
Object
remove(int paramInt)
boolean
remove(Object paramObject)
boolean
removeAll(Collection paramCollection)
Object
removeFirst()
boolean
removeFirstOccurrence(Object paramObject)
Object
removeLast()
boolean
removeLastOccurrence(Object paramObject)
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.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.int
size()
List
subList(int fromIndex, int toIndex)
Object[]
toArray()
Object[]
toArray(Object[] array)
Object[]
toArray(IntFunction generator)
protected Object
writeReplace()
-
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: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 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
-
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 Object clone()
- Overrides:
clone
in classLinkedList
-
add
public void add(int paramInt, Object paramObject)
- Specified by:
add
in interfaceList
- Overrides:
add
in classLinkedList
-
add
public boolean add(Object paramObject)
- Specified by:
add
in interfaceCollection
- Specified by:
add
in interfaceDeque
- Specified by:
add
in interfaceList
- Specified by:
add
in interfaceQueue
- Overrides:
add
in classLinkedList
-
clear
public void clear()
- Specified by:
clear
in interfaceCollection
- Specified by:
clear
in interfaceList
- Overrides:
clear
in classLinkedList
-
addAll
public boolean addAll(Collection paramCollection)
- Specified by:
addAll
in interfaceCollection
- Specified by:
addAll
in interfaceDeque
- Specified by:
addAll
in interfaceList
- Overrides:
addAll
in classLinkedList
-
addAll
public boolean addAll(int paramInt, Collection paramCollection)
- Specified by:
addAll
in interfaceList
- Overrides:
addAll
in classLinkedList
-
remove
public boolean remove(Object paramObject)
- Specified by:
remove
in interfaceCollection
- Specified by:
remove
in interfaceDeque
- Specified by:
remove
in interfaceList
- Overrides:
remove
in classLinkedList
-
remove
public Object remove(int paramInt)
- Specified by:
remove
in interfaceList
- Overrides:
remove
in classLinkedList
-
remove
public Object remove()
-
set
public Object set(int paramInt, Object paramObject)
- Specified by:
set
in interfaceList
- Overrides:
set
in classLinkedList
-
poll
public Object poll()
-
listIterator
public ListIterator listIterator(int paramInt)
- Specified by:
listIterator
in interfaceList
- Overrides:
listIterator
in classLinkedList
-
addFirst
public void addFirst(Object paramObject)
- Specified by:
addFirst
in interfaceDeque
- Overrides:
addFirst
in classLinkedList
-
addLast
public void addLast(Object paramObject)
- Specified by:
addLast
in interfaceDeque
- Overrides:
addLast
in classLinkedList
-
offer
public boolean offer(Object paramObject)
-
removeFirst
public Object removeFirst()
- Specified by:
removeFirst
in interfaceDeque
- Overrides:
removeFirst
in classLinkedList
-
removeLast
public Object removeLast()
- Specified by:
removeLast
in interfaceDeque
- Overrides:
removeLast
in classLinkedList
-
iterator
public Iterator iterator()
- Specified by:
iterator
in interfaceCollection
- Specified by:
iterator
in interfaceDeque
- Specified by:
iterator
in interfaceIterable
- Specified by:
iterator
in interfaceList
- Overrides:
iterator
in classAbstractSequentialList
-
listIterator
public ListIterator listIterator()
- Specified by:
listIterator
in interfaceList
- Overrides:
listIterator
in classAbstractList
-
removeAll
public boolean removeAll(Collection paramCollection)
- Specified by:
removeAll
in interfaceCollection
- Specified by:
removeAll
in interfaceList
- Overrides:
removeAll
in classAbstractCollection
-
retainAll
public boolean retainAll(Collection paramCollection)
- Specified by:
retainAll
in interfaceCollection
- Specified by:
retainAll
in interfaceList
- Overrides:
retainAll
in classAbstractCollection
-
removeFirstOccurrence
public boolean removeFirstOccurrence(Object paramObject)
- Specified by:
removeFirstOccurrence
in interfaceDeque
- Overrides:
removeFirstOccurrence
in classLinkedList
-
removeLastOccurrence
public boolean removeLastOccurrence(Object paramObject)
- Specified by:
removeLastOccurrence
in interfaceDeque
- Overrides:
removeLastOccurrence
in classLinkedList
-
writeReplace
protected Object writeReplace() throws ObjectStreamException
- Throws:
ObjectStreamException
-
equals
public boolean equals(Object paramObject)
- Specified by:
equals
in interfaceCollection
- Specified by:
equals
in interfaceList
- Overrides:
equals
in classAbstractList
-
hashCode
public int hashCode()
- Specified by:
hashCode
in interfaceCollection
- Specified by:
hashCode
in interfaceList
- Overrides:
hashCode
in classAbstractList
-
subList
public List subList(int fromIndex, int toIndex)
- Specified by:
subList
in interfaceList
- Overrides:
subList
in classAbstractList
-
lastIndexOf
public int lastIndexOf(Object o)
- Specified by:
lastIndexOf
in interfaceList
- Overrides:
lastIndexOf
in classLinkedList
-
indexOf
public int indexOf(Object o)
- Specified by:
indexOf
in interfaceList
- Overrides:
indexOf
in classLinkedList
-
get
public Object get(int index)
- Specified by:
get
in interfaceList
- Overrides:
get
in classLinkedList
-
containsAll
public boolean containsAll(Collection c)
- Specified by:
containsAll
in interfaceCollection
- Specified by:
containsAll
in interfaceList
- Overrides:
containsAll
in classAbstractCollection
-
toArray
public Object[] toArray()
- Specified by:
toArray
in interfaceCollection
- Specified by:
toArray
in interfaceList
- Overrides:
toArray
in classLinkedList
-
toArray
public Object[] toArray(Object[] array)
- Specified by:
toArray
in interfaceCollection
- Specified by:
toArray
in interfaceList
- Overrides:
toArray
in classLinkedList
-
toArray
public Object[] toArray(IntFunction generator)
- Specified by:
toArray
in interfaceCollection
-
contains
public boolean contains(Object object)
- Specified by:
contains
in interfaceCollection
- Specified by:
contains
in interfaceDeque
- Specified by:
contains
in interfaceList
- Overrides:
contains
in classLinkedList
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interfaceCollection
- Specified by:
isEmpty
in interfaceList
- Overrides:
isEmpty
in classAbstractCollection
-
size
public int size()
- Specified by:
size
in interfaceCollection
- Specified by:
size
in interfaceDeque
- Specified by:
size
in interfaceList
- Overrides:
size
in classLinkedList
-
offerFirst
public boolean offerFirst(Object paramObject)
- Specified by:
offerFirst
in interfaceDeque
- Overrides:
offerFirst
in classLinkedList
-
offerLast
public boolean offerLast(Object paramObject)
- Specified by:
offerLast
in interfaceDeque
- Overrides:
offerLast
in classLinkedList
-
pollFirst
public Object pollFirst()
- Specified by:
pollFirst
in interfaceDeque
- Overrides:
pollFirst
in classLinkedList
-
pollLast
public Object pollLast()
- Specified by:
pollLast
in interfaceDeque
- Overrides:
pollLast
in classLinkedList
-
getFirst
public Object getFirst()
- Specified by:
getFirst
in interfaceDeque
- Overrides:
getFirst
in classLinkedList
-
getLast
public Object getLast()
- Specified by:
getLast
in interfaceDeque
- Overrides:
getLast
in classLinkedList
-
peekFirst
public Object peekFirst()
- Specified by:
peekFirst
in interfaceDeque
- Overrides:
peekFirst
in classLinkedList
-
peekLast
public Object peekLast()
- Specified by:
peekLast
in interfaceDeque
- Overrides:
peekLast
in classLinkedList
-
element
public Object element()
-
peek
public Object peek()
-
push
public void push(Object o)
- Specified by:
push
in interfaceDeque
- Overrides:
push
in classLinkedList
-
pop
public Object pop()
- Specified by:
pop
in interfaceDeque
- Overrides:
pop
in classLinkedList
-
descendingIterator
public Iterator descendingIterator()
- Specified by:
descendingIterator
in interfaceDeque
- Overrides:
descendingIterator
in classLinkedList
-
-