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
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:
-
Constructor Summary
ConstructorDescriptionDelayedTreeSetProxy
(Collection paramCollection) DelayedTreeSetProxy
(Comparator paramComparator) DelayedTreeSetProxy
(SortedSet paramSortedSet) -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addAll
(Collection paramCollection) void
clear()
clone()
void
Close the broker that is used to service this proxy.boolean
boolean
Return an unproxied copy of the given instance.boolean
first()
Get the broker that is used to service this proxy.Return the change tracker for this proxy, or null if none.int
Returns the expected field index even if this collection was detached.Returns a state manager that can service this proxy even if the collection was detached.The collection element type.getOwner()
Return the owning object.int
Return the owning field index.Returns the state manager of the owning instance.int
hashCode()
boolean
boolean
Returns whether the proxy is detached.boolean
Returns whether the caller has direct-call access to the proxied object.boolean
isEmpty()
iterator()
last()
void
load()
Load the proxy if it was delay-loaded.newInstance
(Class paramClass, Comparator paramComparator, boolean paramBoolean1, boolean paramBoolean2) Create a new instance of this proxy type.pollLast()
boolean
boolean
removeAll
(Collection paramCollection) boolean
retainAll
(Collection paramCollection) protected void
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()
Object[]
toArray()
Object[]
Object[]
toArray
(IntFunction generator) protected Object
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 Details
-
DelayedTreeSetProxy
public DelayedTreeSetProxy() -
DelayedTreeSetProxy
-
DelayedTreeSetProxy
-
DelayedTreeSetProxy
-
-
Method Details
-
setOwner
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
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
Description copied from interface:Proxy
Return the change tracker for this proxy, or null if none.- Specified by:
getChangeTracker
in interfaceProxy
-
setChangeTracker
-
copy
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
Description copied from interface:ProxyCollection
The collection element type.- Specified by:
getElementType
in interfaceProxyCollection
-
setElementType
-
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
-
clone
-
writeReplace
- 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 interfaceDelayedProxy
-
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
-
load
public void load()Description copied from interface:DelayedProxy
Load the proxy if it was delay-loaded.- Specified by:
load
in interfaceDelayedProxy
-
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
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() -
clear
public void clear() -
iterator
- Specified by:
iterator
in interfaceCollection
- Specified by:
iterator
in interfaceIterable
- Specified by:
iterator
in interfaceNavigableSet
- Specified by:
iterator
in interfaceSet
- Overrides:
iterator
in classTreeSet
-
remove
-
size
public int size() -
isEmpty
public boolean isEmpty() -
contains
-
toArray
- Specified by:
toArray
in interfaceCollection
- Specified by:
toArray
in interfaceSet
- Overrides:
toArray
in classAbstractCollection
-
toArray
- Specified by:
toArray
in interfaceCollection
- Specified by:
toArray
in interfaceSet
- Overrides:
toArray
in classAbstractCollection
-
toArray
- Specified by:
toArray
in interfaceCollection
-
comparator
- Specified by:
comparator
in interfaceSortedSet
- Overrides:
comparator
in classTreeSet
-
first
-
last
-
add
-
containsAll
- Specified by:
containsAll
in interfaceCollection
- Specified by:
containsAll
in interfaceSet
- Overrides:
containsAll
in classAbstractCollection
-
addAll
-
retainAll
- Specified by:
retainAll
in interfaceCollection
- Specified by:
retainAll
in interfaceSet
- Overrides:
retainAll
in classAbstractCollection
-
removeAll
- Specified by:
removeAll
in interfaceCollection
- Specified by:
removeAll
in interfaceSet
- Overrides:
removeAll
in classAbstractSet
-
lower
- Specified by:
lower
in interfaceNavigableSet
- Overrides:
lower
in classTreeSet
-
floor
- Specified by:
floor
in interfaceNavigableSet
- Overrides:
floor
in classTreeSet
-
ceiling
- Specified by:
ceiling
in interfaceNavigableSet
- Overrides:
ceiling
in classTreeSet
-
higher
- Specified by:
higher
in interfaceNavigableSet
- Overrides:
higher
in classTreeSet
-
pollFirst
- Specified by:
pollFirst
in interfaceNavigableSet
- Overrides:
pollFirst
in classTreeSet
-
pollLast
- Specified by:
pollLast
in interfaceNavigableSet
- Overrides:
pollLast
in classTreeSet
-
descendingSet
- Specified by:
descendingSet
in interfaceNavigableSet
- Overrides:
descendingSet
in classTreeSet
-
descendingIterator
- Specified by:
descendingIterator
in interfaceNavigableSet
- Overrides:
descendingIterator
in classTreeSet
-
subSet
public NavigableSet subSet(Object fromElement, boolean fromInclusive, Object toElement, boolean toInclusive) - Specified by:
subSet
in interfaceNavigableSet
- Overrides:
subSet
in classTreeSet
-
headSet
- Specified by:
headSet
in interfaceNavigableSet
- Overrides:
headSet
in classTreeSet
-
tailSet
- Specified by:
tailSet
in interfaceNavigableSet
- Overrides:
tailSet
in classTreeSet
-
subSet
-
headSet
-
tailSet
-
equals
- Specified by:
equals
in interfaceCollection
- Specified by:
equals
in interfaceSet
- Overrides:
equals
in classAbstractSet
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfaceCollection
- Specified by:
hashCode
in interfaceSet
- Overrides:
hashCode
in classAbstractSet
-