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:
Serializable,Cloneable,Iterable,Collection,NavigableSet,Set,SortedSet,Proxy,DelayedProxy,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
Constructors Constructor Description DelayedTreeSetProxy()DelayedTreeSetProxy(Collection paramCollection)DelayedTreeSetProxy(Comparator paramComparator)DelayedTreeSetProxy(SortedSet paramSortedSet)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(Object paramObject)booleanaddAll(Collection paramCollection)Objectceiling(Object e)voidclear()Objectclone()voidcloseBroker()Close the broker that is used to service this proxy.Comparatorcomparator()booleancontains(Object object)booleancontainsAll(Collection c)Objectcopy(Object paramObject)Return an unproxied copy of the given instance.IteratordescendingIterator()NavigableSetdescendingSet()booleanequals(Object paramObject)Objectfirst()Objectfloor(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.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()SortedSetheadSet(Object toElement)NavigableSetheadSet(Object toElement, boolean inclusive)Objecthigher(Object e)booleanisDelayLoad()booleanisDetached()Returns whether the proxy is detached.booleanisDirectAccess()Returns whether the caller has direct-call access to the proxied object.booleanisEmpty()Iteratoriterator()Objectlast()voidload()Load the proxy if it was delay-loaded.Objectlower(Object e)ProxyCollectionnewInstance(Class paramClass, Comparator paramComparator, boolean paramBoolean1, boolean paramBoolean2)Create a new instance of this proxy type.ObjectpollFirst()ObjectpollLast()booleanremove(Object paramObject)booleanremoveAll(Collection paramCollection)booleanretainAll(Collection paramCollection)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()NavigableSetsubSet(Object fromElement, boolean fromInclusive, Object toElement, boolean toInclusive)SortedSetsubSet(Object fromElement, Object toElement)SortedSettailSet(Object fromElement)NavigableSettailSet(Object fromElement, boolean inclusive)Object[]toArray()Object[]toArray(Object[] array)Object[]toArray(IntFunction generator)protected ObjectwriteReplace()-
Methods inherited from class java.util.TreeSet
spliterator
-
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
-
-
-
-
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: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
-
writeReplace
protected Object writeReplace() throws ObjectStreamException
- Throws:
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()
-
iterator
public Iterator iterator()
- Specified by:
iteratorin interfaceCollection- Specified by:
iteratorin interfaceIterable- Specified by:
iteratorin interfaceNavigableSet- Specified by:
iteratorin interfaceSet- Overrides:
iteratorin classTreeSet
-
remove
public boolean remove(Object paramObject)
-
size
public int size()
-
isEmpty
public boolean isEmpty()
-
contains
public boolean contains(Object object)
-
toArray
public Object[] toArray()
- Specified by:
toArrayin interfaceCollection- Specified by:
toArrayin interfaceSet- Overrides:
toArrayin classAbstractCollection
-
toArray
public Object[] toArray(Object[] array)
- Specified by:
toArrayin interfaceCollection- Specified by:
toArrayin interfaceSet- Overrides:
toArrayin classAbstractCollection
-
toArray
public Object[] toArray(IntFunction generator)
- Specified by:
toArrayin interfaceCollection
-
comparator
public Comparator comparator()
- Specified by:
comparatorin interfaceSortedSet- Overrides:
comparatorin classTreeSet
-
first
public Object first()
-
last
public Object last()
-
add
public boolean add(Object paramObject)
-
containsAll
public boolean containsAll(Collection c)
- Specified by:
containsAllin interfaceCollection- Specified by:
containsAllin interfaceSet- Overrides:
containsAllin classAbstractCollection
-
addAll
public boolean addAll(Collection paramCollection)
-
retainAll
public boolean retainAll(Collection paramCollection)
- Specified by:
retainAllin interfaceCollection- Specified by:
retainAllin interfaceSet- Overrides:
retainAllin classAbstractCollection
-
removeAll
public boolean removeAll(Collection paramCollection)
- Specified by:
removeAllin interfaceCollection- Specified by:
removeAllin interfaceSet- Overrides:
removeAllin classAbstractSet
-
lower
public Object lower(Object e)
- Specified by:
lowerin interfaceNavigableSet- Overrides:
lowerin classTreeSet
-
floor
public Object floor(Object e)
- Specified by:
floorin interfaceNavigableSet- Overrides:
floorin classTreeSet
-
ceiling
public Object ceiling(Object e)
- Specified by:
ceilingin interfaceNavigableSet- Overrides:
ceilingin classTreeSet
-
higher
public Object higher(Object e)
- Specified by:
higherin interfaceNavigableSet- Overrides:
higherin classTreeSet
-
pollFirst
public Object pollFirst()
- Specified by:
pollFirstin interfaceNavigableSet- Overrides:
pollFirstin classTreeSet
-
pollLast
public Object pollLast()
- Specified by:
pollLastin interfaceNavigableSet- Overrides:
pollLastin classTreeSet
-
descendingSet
public NavigableSet descendingSet()
- Specified by:
descendingSetin interfaceNavigableSet- Overrides:
descendingSetin classTreeSet
-
descendingIterator
public Iterator descendingIterator()
- Specified by:
descendingIteratorin interfaceNavigableSet- Overrides:
descendingIteratorin classTreeSet
-
subSet
public NavigableSet subSet(Object fromElement, boolean fromInclusive, Object toElement, boolean toInclusive)
- Specified by:
subSetin interfaceNavigableSet- Overrides:
subSetin classTreeSet
-
headSet
public NavigableSet headSet(Object toElement, boolean inclusive)
- Specified by:
headSetin interfaceNavigableSet- Overrides:
headSetin classTreeSet
-
tailSet
public NavigableSet tailSet(Object fromElement, boolean inclusive)
- Specified by:
tailSetin interfaceNavigableSet- Overrides:
tailSetin classTreeSet
-
equals
public boolean equals(Object paramObject)
- Specified by:
equalsin interfaceCollection- Specified by:
equalsin interfaceSet- Overrides:
equalsin classAbstractSet
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfaceCollection- Specified by:
hashCodein interfaceSet- Overrides:
hashCodein classAbstractSet
-
-