Package org.apache.openjpa.util.proxy
Class DelayedTreeSetProxy
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<E>
-
- java.util.TreeSet
-
- org.apache.openjpa.util.proxy.DelayedTreeSetProxy
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.lang.Iterable,java.util.Collection,java.util.NavigableSet,java.util.Set,java.util.SortedSet,Proxy,DelayedProxy,ProxyCollection
public class DelayedTreeSetProxy extends java.util.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
Constructors Constructor Description DelayedTreeSetProxy()DelayedTreeSetProxy(java.util.Collection paramCollection)DelayedTreeSetProxy(java.util.Comparator paramComparator)DelayedTreeSetProxy(java.util.SortedSet paramSortedSet)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(java.lang.Object paramObject)booleanaddAll(java.util.Collection paramCollection)java.lang.Objectceiling(java.lang.Object e)voidclear()java.lang.Objectclone()voidcloseBroker()Close the broker that is used to service this proxy.java.util.Comparatorcomparator()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.util.NavigableSetdescendingSet()booleanequals(java.lang.Object paramObject)java.lang.Objectfirst()java.lang.Objectfloor(java.lang.Object e)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.OpenJPAStateManagergetOwner()Return the owning object.intgetOwnerField()Return the owning field index.OpenJPAStateManagergetOwnerStateManager()Returns the state manager of the owning instance.inthashCode()java.util.SortedSetheadSet(java.lang.Object toElement)java.util.NavigableSetheadSet(java.lang.Object toElement, boolean inclusive)java.lang.Objecthigher(java.lang.Object e)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()java.lang.Objectlast()voidload()Load the proxy if it was delay-loaded.java.lang.Objectlower(java.lang.Object e)ProxyCollectionnewInstance(java.lang.Class paramClass, java.util.Comparator paramComparator, boolean paramBoolean1, boolean paramBoolean2)Create a new instance of this proxy type.java.lang.ObjectpollFirst()java.lang.ObjectpollLast()booleanremove(java.lang.Object paramObject)booleanremoveAll(java.util.Collection paramCollection)booleanretainAll(java.util.Collection paramCollection)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.NavigableSetsubSet(java.lang.Object fromElement, boolean fromInclusive, java.lang.Object toElement, boolean toInclusive)java.util.SortedSetsubSet(java.lang.Object fromElement, java.lang.Object toElement)java.util.SortedSettailSet(java.lang.Object fromElement)java.util.NavigableSettailSet(java.lang.Object fromElement, boolean inclusive)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()
-
-
-
Constructor Detail
-
DelayedTreeSetProxy
public DelayedTreeSetProxy()
-
DelayedTreeSetProxy
public DelayedTreeSetProxy(java.util.Comparator paramComparator)
-
DelayedTreeSetProxy
public DelayedTreeSetProxy(java.util.Collection paramCollection)
-
DelayedTreeSetProxy
public DelayedTreeSetProxy(java.util.SortedSet paramSortedSet)
-
-
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
-
clone
public java.lang.Object clone()
- Overrides:
clonein classjava.util.TreeSet
-
writeReplace
protected java.lang.Object writeReplace() throws java.io.ObjectStreamException- Throws:
java.io.ObjectStreamException
-
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()
-
clear
public void clear()
- Specified by:
clearin interfacejava.util.Collection- Specified by:
clearin interfacejava.util.Set- Overrides:
clearin classjava.util.TreeSet
-
iterator
public java.util.Iterator iterator()
- Specified by:
iteratorin interfacejava.util.Collection- Specified by:
iteratorin interfacejava.lang.Iterable- Specified by:
iteratorin interfacejava.util.NavigableSet- Specified by:
iteratorin interfacejava.util.Set- Overrides:
iteratorin classjava.util.TreeSet
-
remove
public boolean remove(java.lang.Object paramObject)
- Specified by:
removein interfacejava.util.Collection- Specified by:
removein interfacejava.util.Set- Overrides:
removein classjava.util.TreeSet
-
size
public int size()
- Specified by:
sizein interfacejava.util.Collection- Specified by:
sizein interfacejava.util.Set- Overrides:
sizein classjava.util.TreeSet
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfacejava.util.Collection- Specified by:
isEmptyin interfacejava.util.Set- Overrides:
isEmptyin classjava.util.TreeSet
-
contains
public boolean contains(java.lang.Object object)
- Specified by:
containsin interfacejava.util.Collection- Specified by:
containsin interfacejava.util.Set- Overrides:
containsin classjava.util.TreeSet
-
toArray
public java.lang.Object[] toArray()
- Specified by:
toArrayin interfacejava.util.Collection- Specified by:
toArrayin interfacejava.util.Set- Overrides:
toArrayin classjava.util.AbstractCollection
-
toArray
public java.lang.Object[] toArray(java.lang.Object[] array)
- Specified by:
toArrayin interfacejava.util.Collection- Specified by:
toArrayin interfacejava.util.Set- Overrides:
toArrayin classjava.util.AbstractCollection
-
toArray
public java.lang.Object[] toArray(java.util.function.IntFunction generator)
- Specified by:
toArrayin interfacejava.util.Collection
-
comparator
public java.util.Comparator comparator()
- Specified by:
comparatorin interfacejava.util.SortedSet- Overrides:
comparatorin classjava.util.TreeSet
-
first
public java.lang.Object first()
- Specified by:
firstin interfacejava.util.SortedSet- Overrides:
firstin classjava.util.TreeSet
-
last
public java.lang.Object last()
- Specified by:
lastin interfacejava.util.SortedSet- Overrides:
lastin classjava.util.TreeSet
-
add
public boolean add(java.lang.Object paramObject)
- Specified by:
addin interfacejava.util.Collection- Specified by:
addin interfacejava.util.Set- Overrides:
addin classjava.util.TreeSet
-
containsAll
public boolean containsAll(java.util.Collection c)
- Specified by:
containsAllin interfacejava.util.Collection- Specified by:
containsAllin interfacejava.util.Set- Overrides:
containsAllin classjava.util.AbstractCollection
-
addAll
public boolean addAll(java.util.Collection paramCollection)
- Specified by:
addAllin interfacejava.util.Collection- Specified by:
addAllin interfacejava.util.Set- Overrides:
addAllin classjava.util.TreeSet
-
retainAll
public boolean retainAll(java.util.Collection paramCollection)
- Specified by:
retainAllin interfacejava.util.Collection- Specified by:
retainAllin interfacejava.util.Set- Overrides:
retainAllin classjava.util.AbstractCollection
-
removeAll
public boolean removeAll(java.util.Collection paramCollection)
- Specified by:
removeAllin interfacejava.util.Collection- Specified by:
removeAllin interfacejava.util.Set- Overrides:
removeAllin classjava.util.AbstractSet
-
lower
public java.lang.Object lower(java.lang.Object e)
- Specified by:
lowerin interfacejava.util.NavigableSet- Overrides:
lowerin classjava.util.TreeSet
-
floor
public java.lang.Object floor(java.lang.Object e)
- Specified by:
floorin interfacejava.util.NavigableSet- Overrides:
floorin classjava.util.TreeSet
-
ceiling
public java.lang.Object ceiling(java.lang.Object e)
- Specified by:
ceilingin interfacejava.util.NavigableSet- Overrides:
ceilingin classjava.util.TreeSet
-
higher
public java.lang.Object higher(java.lang.Object e)
- Specified by:
higherin interfacejava.util.NavigableSet- Overrides:
higherin classjava.util.TreeSet
-
pollFirst
public java.lang.Object pollFirst()
- Specified by:
pollFirstin interfacejava.util.NavigableSet- Overrides:
pollFirstin classjava.util.TreeSet
-
pollLast
public java.lang.Object pollLast()
- Specified by:
pollLastin interfacejava.util.NavigableSet- Overrides:
pollLastin classjava.util.TreeSet
-
descendingSet
public java.util.NavigableSet descendingSet()
- Specified by:
descendingSetin interfacejava.util.NavigableSet- Overrides:
descendingSetin classjava.util.TreeSet
-
descendingIterator
public java.util.Iterator descendingIterator()
- Specified by:
descendingIteratorin interfacejava.util.NavigableSet- Overrides:
descendingIteratorin classjava.util.TreeSet
-
subSet
public java.util.NavigableSet subSet(java.lang.Object fromElement, boolean fromInclusive, java.lang.Object toElement, boolean toInclusive)- Specified by:
subSetin interfacejava.util.NavigableSet- Overrides:
subSetin classjava.util.TreeSet
-
headSet
public java.util.NavigableSet headSet(java.lang.Object toElement, boolean inclusive)- Specified by:
headSetin interfacejava.util.NavigableSet- Overrides:
headSetin classjava.util.TreeSet
-
tailSet
public java.util.NavigableSet tailSet(java.lang.Object fromElement, boolean inclusive)- Specified by:
tailSetin interfacejava.util.NavigableSet- Overrides:
tailSetin classjava.util.TreeSet
-
subSet
public java.util.SortedSet subSet(java.lang.Object fromElement, java.lang.Object toElement)- Specified by:
subSetin interfacejava.util.NavigableSet- Specified by:
subSetin interfacejava.util.SortedSet- Overrides:
subSetin classjava.util.TreeSet
-
headSet
public java.util.SortedSet headSet(java.lang.Object toElement)
- Specified by:
headSetin interfacejava.util.NavigableSet- Specified by:
headSetin interfacejava.util.SortedSet- Overrides:
headSetin classjava.util.TreeSet
-
tailSet
public java.util.SortedSet tailSet(java.lang.Object fromElement)
- Specified by:
tailSetin interfacejava.util.NavigableSet- Specified by:
tailSetin interfacejava.util.SortedSet- Overrides:
tailSetin classjava.util.TreeSet
-
equals
public boolean equals(java.lang.Object paramObject)
- Specified by:
equalsin interfacejava.util.Collection- Specified by:
equalsin interfacejava.util.Set- Overrides:
equalsin classjava.util.AbstractSet
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfacejava.util.Collection- Specified by:
hashCodein interfacejava.util.Set- Overrides:
hashCodein classjava.util.AbstractSet
-
-