org.apache.openjpa.util
Class DelayedLinkedListProxy

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.AbstractSequentialList<E>
              extended by java.util.LinkedList
                  extended by org.apache.openjpa.util.DelayedLinkedListProxy
All Implemented Interfaces:
Serializable, Cloneable, Iterable, Collection, Deque, List, Queue, DelayedProxy, Proxy, 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
DelayedLinkedListProxy()
           
DelayedLinkedListProxy(Collection paramCollection)
           
 
Method Summary
 void add(int paramInt, Object paramObject)
           
 boolean add(Object paramObject)
           
 boolean addAll(Collection paramCollection)
           
 boolean addAll(int paramInt, 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)
           
protected  Object writeReplace()
           
 
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
 

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.

Specified by:
setOwner in interface Proxy

getOwner

public OpenJPAStateManager getOwner()
Description copied from interface: Proxy
Return the owning object.

Specified by:
getOwner in interface Proxy

getOwnerField

public int getOwnerField()
Description copied from interface: Proxy
Return the owning field index.

Specified by:
getOwnerField in interface Proxy

getChangeTracker

public ChangeTracker getChangeTracker()
Description copied from interface: Proxy
Return the change tracker for this proxy, or null if none.

Specified by:
getChangeTracker in interface Proxy

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.

Specified by:
copy in interface Proxy

getElementType

public Class getElementType()
Description copied from interface: ProxyCollection
The collection element type.

Specified by:
getElementType in interface ProxyCollection

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 interface ProxyCollection

getDelayedField

public int getDelayedField()
Description copied from interface: DelayedProxy
Returns the expected field index even if this collection was detached.

Specified by:
getDelayedField in interface DelayedProxy
Returns:

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 interface DelayedProxy

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 interface DelayedProxy

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 interface DelayedProxy

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 interface DelayedProxy

getBroker

public Broker getBroker()
Description copied from interface: DelayedProxy
Get the broker that is used to service this proxy.

Specified by:
getBroker in interface DelayedProxy

closeBroker

public void closeBroker()
Description copied from interface: DelayedProxy
Close the broker that is used to service this proxy.

Specified by:
closeBroker in interface DelayedProxy

getOwnerStateManager

public OpenJPAStateManager getOwnerStateManager()
Description copied from interface: DelayedProxy
Returns the state manager of the owning instance.

Specified by:
getOwnerStateManager in interface DelayedProxy

isDetached

public boolean isDetached()
Description copied from interface: DelayedProxy
Returns whether the proxy is detached.

Specified by:
isDetached in interface DelayedProxy
Returns:

isDelayLoad

public boolean isDelayLoad()

clone

public Object clone()
Overrides:
clone in class LinkedList

add

public void add(int paramInt,
                Object paramObject)
Specified by:
add in interface List
Overrides:
add in class LinkedList

add

public boolean add(Object paramObject)
Specified by:
add in interface Collection
Specified by:
add in interface Deque
Specified by:
add in interface List
Specified by:
add in interface Queue
Overrides:
add in class LinkedList

clear

public void clear()
Specified by:
clear in interface Collection
Specified by:
clear in interface List
Overrides:
clear in class LinkedList

addAll

public boolean addAll(Collection paramCollection)
Specified by:
addAll in interface Collection
Specified by:
addAll in interface List
Overrides:
addAll in class LinkedList

addAll

public boolean addAll(int paramInt,
                      Collection paramCollection)
Specified by:
addAll in interface List
Overrides:
addAll in class LinkedList

remove

public boolean remove(Object paramObject)
Specified by:
remove in interface Collection
Specified by:
remove in interface Deque
Specified by:
remove in interface List
Overrides:
remove in class LinkedList

remove

public Object remove(int paramInt)
Specified by:
remove in interface List
Overrides:
remove in class LinkedList

remove

public Object remove()
Specified by:
remove in interface Deque
Specified by:
remove in interface Queue
Overrides:
remove in class LinkedList

set

public Object set(int paramInt,
                  Object paramObject)
Specified by:
set in interface List
Overrides:
set in class LinkedList

poll

public Object poll()
Specified by:
poll in interface Deque
Specified by:
poll in interface Queue
Overrides:
poll in class LinkedList

listIterator

public ListIterator listIterator(int paramInt)
Specified by:
listIterator in interface List
Overrides:
listIterator in class LinkedList

addFirst

public void addFirst(Object paramObject)
Specified by:
addFirst in interface Deque
Overrides:
addFirst in class LinkedList

addLast

public void addLast(Object paramObject)
Specified by:
addLast in interface Deque
Overrides:
addLast in class LinkedList

offer

public boolean offer(Object paramObject)
Specified by:
offer in interface Deque
Specified by:
offer in interface Queue
Overrides:
offer in class LinkedList

removeFirst

public Object removeFirst()
Specified by:
removeFirst in interface Deque
Overrides:
removeFirst in class LinkedList

removeLast

public Object removeLast()
Specified by:
removeLast in interface Deque
Overrides:
removeLast in class LinkedList

iterator

public Iterator iterator()
Specified by:
iterator in interface Iterable
Specified by:
iterator in interface Collection
Specified by:
iterator in interface Deque
Specified by:
iterator in interface List
Overrides:
iterator in class AbstractSequentialList

listIterator

public ListIterator listIterator()
Specified by:
listIterator in interface List
Overrides:
listIterator in class AbstractList

removeAll

public boolean removeAll(Collection paramCollection)
Specified by:
removeAll in interface Collection
Specified by:
removeAll in interface List
Overrides:
removeAll in class AbstractCollection

retainAll

public boolean retainAll(Collection paramCollection)
Specified by:
retainAll in interface Collection
Specified by:
retainAll in interface List
Overrides:
retainAll in class AbstractCollection

removeFirstOccurrence

public boolean removeFirstOccurrence(Object paramObject)
Specified by:
removeFirstOccurrence in interface Deque
Overrides:
removeFirstOccurrence in class LinkedList

removeLastOccurrence

public boolean removeLastOccurrence(Object paramObject)
Specified by:
removeLastOccurrence in interface Deque
Overrides:
removeLastOccurrence in class LinkedList

writeReplace

protected Object writeReplace()
                       throws ObjectStreamException
Throws:
ObjectStreamException

equals

public boolean equals(Object paramObject)
Specified by:
equals in interface Collection
Specified by:
equals in interface List
Overrides:
equals in class AbstractList

hashCode

public int hashCode()
Specified by:
hashCode in interface Collection
Specified by:
hashCode in interface List
Overrides:
hashCode in class AbstractList

subList

public List subList(int fromIndex,
                    int toIndex)
Specified by:
subList in interface List
Overrides:
subList in class AbstractList

lastIndexOf

public int lastIndexOf(Object o)
Specified by:
lastIndexOf in interface List
Overrides:
lastIndexOf in class LinkedList

indexOf

public int indexOf(Object o)
Specified by:
indexOf in interface List
Overrides:
indexOf in class LinkedList

get

public Object get(int index)
Specified by:
get in interface List
Overrides:
get in class LinkedList

containsAll

public boolean containsAll(Collection c)
Specified by:
containsAll in interface Collection
Specified by:
containsAll in interface List
Overrides:
containsAll in class AbstractCollection

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection
Specified by:
toArray in interface List
Overrides:
toArray in class LinkedList

toArray

public Object[] toArray(Object[] array)
Specified by:
toArray in interface Collection
Specified by:
toArray in interface List
Overrides:
toArray in class LinkedList

contains

public boolean contains(Object object)
Specified by:
contains in interface Collection
Specified by:
contains in interface Deque
Specified by:
contains in interface List
Overrides:
contains in class LinkedList

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection
Specified by:
isEmpty in interface List
Overrides:
isEmpty in class AbstractCollection

size

public int size()
Specified by:
size in interface Collection
Specified by:
size in interface Deque
Specified by:
size in interface List
Overrides:
size in class LinkedList

offerFirst

public boolean offerFirst(Object paramObject)
Specified by:
offerFirst in interface Deque
Overrides:
offerFirst in class LinkedList

offerLast

public boolean offerLast(Object paramObject)
Specified by:
offerLast in interface Deque
Overrides:
offerLast in class LinkedList

pollFirst

public Object pollFirst()
Specified by:
pollFirst in interface Deque
Overrides:
pollFirst in class LinkedList

pollLast

public Object pollLast()
Specified by:
pollLast in interface Deque
Overrides:
pollLast in class LinkedList

getFirst

public Object getFirst()
Specified by:
getFirst in interface Deque
Overrides:
getFirst in class LinkedList

getLast

public Object getLast()
Specified by:
getLast in interface Deque
Overrides:
getLast in class LinkedList

peekFirst

public Object peekFirst()
Specified by:
peekFirst in interface Deque
Overrides:
peekFirst in class LinkedList

peekLast

public Object peekLast()
Specified by:
peekLast in interface Deque
Overrides:
peekLast in class LinkedList

element

public Object element()
Specified by:
element in interface Deque
Specified by:
element in interface Queue
Overrides:
element in class LinkedList

peek

public Object peek()
Specified by:
peek in interface Deque
Specified by:
peek in interface Queue
Overrides:
peek in class LinkedList

push

public void push(Object o)
Specified by:
push in interface Deque
Overrides:
push in class LinkedList

pop

public Object pop()
Specified by:
pop in interface Deque
Overrides:
pop in class LinkedList

descendingIterator

public Iterator descendingIterator()
Specified by:
descendingIterator in interface Deque
Overrides:
descendingIterator in class LinkedList


Copyright © 2006-2013 Apache Software Foundation. All Rights Reserved.