org.apache.openjpa.util
Class DelayedTreeSetProxy

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractSet<E>
          extended by java.util.TreeSet
              extended by org.apache.openjpa.util.DelayedTreeSetProxy
All Implemented Interfaces:
Serializable, Cloneable, Iterable, Collection, NavigableSet, Set, SortedSet, DelayedProxy, Proxy, ProxyCollection

public class DelayedTreeSetProxy
extends TreeSet
implements ProxyCollection, DelayedProxy

TreeSet 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
DelayedTreeSetProxy()
           
DelayedTreeSetProxy(Collection paramCollection)
           
DelayedTreeSetProxy(Comparator paramComparator)
           
DelayedTreeSetProxy(SortedSet paramSortedSet)
           
 
Method Summary
 boolean add(Object paramObject)
           
 boolean addAll(Collection paramCollection)
           
 Object ceiling(Object e)
           
 void clear()
           
 Object clone()
           
 void closeBroker()
          Close the broker that is used to service this proxy.
 Comparator comparator()
           
 boolean contains(Object object)
           
 boolean containsAll(Collection c)
           
 Object copy(Object paramObject)
          Return an unproxied copy of the given instance.
 Iterator descendingIterator()
           
 NavigableSet descendingSet()
           
 boolean equals(Object paramObject)
           
 Object first()
           
 Object floor(Object e)
           
 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.
 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()
           
 SortedSet headSet(Object toElement)
           
 NavigableSet headSet(Object toElement, boolean inclusive)
           
 Object higher(Object e)
           
 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()
           
 Object last()
           
 void load()
          Load the proxy if it was delay-loaded.
 Object lower(Object e)
           
 ProxyCollection newInstance(Class paramClass, Comparator paramComparator, boolean paramBoolean1, boolean paramBoolean2)
          Create a new instance of this proxy type.
 Object pollFirst()
           
 Object pollLast()
           
 boolean remove(Object paramObject)
           
 boolean removeAll(Collection paramCollection)
           
 boolean retainAll(Collection paramCollection)
           
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()
           
 NavigableSet subSet(Object fromElement, boolean fromInclusive, Object toElement, boolean toInclusive)
           
 SortedSet subSet(Object fromElement, Object toElement)
           
 SortedSet tailSet(Object fromElement)
           
 NavigableSet tailSet(Object fromElement, boolean inclusive)
           
 Object[] toArray()
           
 Object[] toArray(Object[] array)
           
protected  Object writeReplace()
           
 
Methods inherited from class java.util.AbstractCollection
toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DelayedTreeSetProxy

public DelayedTreeSetProxy()

DelayedTreeSetProxy

public DelayedTreeSetProxy(Comparator paramComparator)

DelayedTreeSetProxy

public DelayedTreeSetProxy(Collection paramCollection)

DelayedTreeSetProxy

public DelayedTreeSetProxy(SortedSet paramSortedSet)
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

clone

public Object clone()
Overrides:
clone in class TreeSet

writeReplace

protected Object writeReplace()
                       throws ObjectStreamException
Throws:
ObjectStreamException

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()

clear

public void clear()
Specified by:
clear in interface Collection
Specified by:
clear in interface Set
Overrides:
clear in class TreeSet

iterator

public Iterator iterator()
Specified by:
iterator in interface Iterable
Specified by:
iterator in interface Collection
Specified by:
iterator in interface NavigableSet
Specified by:
iterator in interface Set
Overrides:
iterator in class TreeSet

remove

public boolean remove(Object paramObject)
Specified by:
remove in interface Collection
Specified by:
remove in interface Set
Overrides:
remove in class TreeSet

size

public int size()
Specified by:
size in interface Collection
Specified by:
size in interface Set
Overrides:
size in class TreeSet

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Collection
Specified by:
isEmpty in interface Set
Overrides:
isEmpty in class TreeSet

contains

public boolean contains(Object object)
Specified by:
contains in interface Collection
Specified by:
contains in interface Set
Overrides:
contains in class TreeSet

toArray

public Object[] toArray()
Specified by:
toArray in interface Collection
Specified by:
toArray in interface Set
Overrides:
toArray in class AbstractCollection

toArray

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

comparator

public Comparator comparator()
Specified by:
comparator in interface SortedSet
Overrides:
comparator in class TreeSet

first

public Object first()
Specified by:
first in interface SortedSet
Overrides:
first in class TreeSet

last

public Object last()
Specified by:
last in interface SortedSet
Overrides:
last in class TreeSet

add

public boolean add(Object paramObject)
Specified by:
add in interface Collection
Specified by:
add in interface Set
Overrides:
add in class TreeSet

containsAll

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

addAll

public boolean addAll(Collection paramCollection)
Specified by:
addAll in interface Collection
Specified by:
addAll in interface Set
Overrides:
addAll in class TreeSet

retainAll

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

removeAll

public boolean removeAll(Collection paramCollection)
Specified by:
removeAll in interface Collection
Specified by:
removeAll in interface Set
Overrides:
removeAll in class AbstractSet

lower

public Object lower(Object e)
Specified by:
lower in interface NavigableSet
Overrides:
lower in class TreeSet

floor

public Object floor(Object e)
Specified by:
floor in interface NavigableSet
Overrides:
floor in class TreeSet

ceiling

public Object ceiling(Object e)
Specified by:
ceiling in interface NavigableSet
Overrides:
ceiling in class TreeSet

higher

public Object higher(Object e)
Specified by:
higher in interface NavigableSet
Overrides:
higher in class TreeSet

pollFirst

public Object pollFirst()
Specified by:
pollFirst in interface NavigableSet
Overrides:
pollFirst in class TreeSet

pollLast

public Object pollLast()
Specified by:
pollLast in interface NavigableSet
Overrides:
pollLast in class TreeSet

descendingSet

public NavigableSet descendingSet()
Specified by:
descendingSet in interface NavigableSet
Overrides:
descendingSet in class TreeSet

descendingIterator

public Iterator descendingIterator()
Specified by:
descendingIterator in interface NavigableSet
Overrides:
descendingIterator in class TreeSet

subSet

public NavigableSet subSet(Object fromElement,
                           boolean fromInclusive,
                           Object toElement,
                           boolean toInclusive)
Specified by:
subSet in interface NavigableSet
Overrides:
subSet in class TreeSet

headSet

public NavigableSet headSet(Object toElement,
                            boolean inclusive)
Specified by:
headSet in interface NavigableSet
Overrides:
headSet in class TreeSet

tailSet

public NavigableSet tailSet(Object fromElement,
                            boolean inclusive)
Specified by:
tailSet in interface NavigableSet
Overrides:
tailSet in class TreeSet

subSet

public SortedSet subSet(Object fromElement,
                        Object toElement)
Specified by:
subSet in interface NavigableSet
Specified by:
subSet in interface SortedSet
Overrides:
subSet in class TreeSet

headSet

public SortedSet headSet(Object toElement)
Specified by:
headSet in interface NavigableSet
Specified by:
headSet in interface SortedSet
Overrides:
headSet in class TreeSet

tailSet

public SortedSet tailSet(Object fromElement)
Specified by:
tailSet in interface NavigableSet
Specified by:
tailSet in interface SortedSet
Overrides:
tailSet in class TreeSet

equals

public boolean equals(Object paramObject)
Specified by:
equals in interface Collection
Specified by:
equals in interface Set
Overrides:
equals in class AbstractSet

hashCode

public int hashCode()
Specified by:
hashCode in interface Collection
Specified by:
hashCode in interface Set
Overrides:
hashCode in class AbstractSet


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