E - the type of elements maintained by this setpublic class IndirectSet<E> extends Object implements CollectionChangeTracker, Set<E>, IndirectCollection<E,Set<E>>, Cloneable, Serializable
To use an IndirectSet:
Implementation notes:
CollectionMapping,
Serialized Form| Modifier and Type | Field and Description |
|---|---|
protected int |
initialCapacity
Store initial size for lazy init.
|
protected float |
loadFactor
Store load factor for lazy init.
|
| Constructor and Description |
|---|
IndirectSet()
Construct an empty IndirectSet.
|
IndirectSet(Collection<? extends E> c)
Construct an IndirectSet containing the elements of the specified collection.
|
IndirectSet(int initialCapacity)
Construct an empty IndirectSet with the specified initial capacity.
|
IndirectSet(int initialCapacity,
float loadFactor)
Construct an empty IndirectSet with the specified initial capacity and
load factor.
|
| Modifier and Type | Method and Description |
|---|---|
PropertyChangeListener |
_persistence_getPropertyChangeListener()
INTERNAL:
Return the property change listener for change tracking.
|
void |
_persistence_setPropertyChangeListener(PropertyChangeListener changeListener)
INTERNAL:
Set the property change listener for change tracking.
|
boolean |
add(E element) |
boolean |
addAll(Collection<? extends E> c) |
protected Set<E> |
buildDelegate()
INTERNAL:
Return the freshly-built delegate.
|
void |
clear() |
void |
clearDeferredChanges()
INTERNAL:
clear any changes that have been deferred to instantiation.
|
Object |
clone() |
protected Set<E> |
cloneDelegate()
INTERNAL:
Clone the delegate.
|
boolean |
contains(Object element) |
boolean |
containsAll(Collection<?> c) |
boolean |
equals(Object o) |
void |
forEach(Consumer<? super E> action) |
Collection<E> |
getAddedElements()
INTERNAL:
Return the elements that have been added before instantiation.
|
protected Set<E> |
getDelegate()
INTERNAL:
Check whether the contents have been read from the database.
|
Set<E> |
getDelegateObject()
INTERNAL:
Return the real collection object.
|
Collection<E> |
getRemovedElements()
INTERNAL:
Return the elements that have been removed before instantiation.
|
String |
getTrackedAttributeName()
INTERNAL:
Return the mapping attribute name, used to raise change events.
|
ValueHolderInterface<Set<E>> |
getValueHolder()
INTERNAL:
Return the valueHolder.
|
boolean |
hasAddedElements()
INTERNAL:
Return if any elements that have been added before instantiation.
|
boolean |
hasBeenRegistered()
INTERNAL:
Return whether this IndirectSet has been registered in a UnitOfWork
|
boolean |
hasDeferredChanges()
INTERNAL:
Return if any elements that have been added or removed before instantiation.
|
int |
hashCode() |
boolean |
hasRemovedElements()
INTERNAL:
Return if any elements that have been removed before instantiation.
|
boolean |
hasTrackedPropertyChangeListener()
INTERNAL:
Return if the collection has a property change listener for change tracking.
|
boolean |
isEmpty() |
boolean |
isInstantiated()
Return whether the contents have been read from the database.
|
protected boolean |
isRelationshipMaintenanceRequired() |
Iterator<E> |
iterator() |
Stream<E> |
parallelStream() |
protected void |
raiseAddChangeEvent(Object element)
Raise the add change event and relationship maintainence.
|
protected void |
raiseRemoveChangeEvent(Object element)
Raise the remove change event.
|
boolean |
remove(Object element) |
boolean |
removeAll(Collection<?> c) |
boolean |
removeIf(Predicate<? super E> filter) |
boolean |
retainAll(Collection<?> c) |
void |
setTrackedAttributeName(String attributeName)
INTERNAL:
Set the mapping attribute name, used to raise change events.
|
void |
setUseLazyInstantiation(boolean useLazyInstantiation)
INTERNAL
Set whether this collection should attempt do deal with adds and removes without retrieving the
collection from the dB
|
void |
setValueHolder(ValueHolderInterface<Set<E>> valueHolder)
INTERNAL:
Set the value holder.
|
protected boolean |
shouldAvoidInstantiation()
INTERNAL:
Return if add/remove should trigger instantiation or avoid.
|
protected boolean |
shouldUseLazyInstantiation()
Return whether this collection should attempt do deal with adds and removes without retrieving the
collection from the dB
|
int |
size() |
Spliterator<E> |
spliterator() |
Stream<E> |
stream() |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
String |
toString()
Use the delegate's #toString(); but wrap it with braces to indicate
there is a bit of indirection.
|
protected int initialCapacity
protected float loadFactor
public IndirectSet()
public IndirectSet(int initialCapacity)
initialCapacity - the initial capacity of the setIllegalArgumentException - if the specified initial capacity
is negativepublic IndirectSet(int initialCapacity,
float loadFactor)
initialCapacity - the initial capacity of the setloadFactor - the load factor of the setIllegalArgumentException - if the specified initial capacity
is negativepublic IndirectSet(Collection<? extends E> c)
c - the initial elements of the setprotected boolean isRelationshipMaintenanceRequired()
public boolean add(E element)
add in interface Collection<E>add in interface Set<E>Set.add(java.lang.Object)public boolean addAll(Collection<? extends E> c)
addAll in interface Collection<E>addAll in interface Set<E>Set.addAll(java.util.Collection)public void clear()
clear in interface Collection<E>clear in interface Set<E>Set.clear()public void clearDeferredChanges()
clearDeferredChanges in interface IndirectCollection<E,Set<E>>public Object clone()
clone in class ObjectThis will result in a database query if necessary.public boolean contains(Object element)
contains in interface Collection<E>contains in interface Set<E>Set.contains(java.lang.Object)public boolean containsAll(Collection<?> c)
containsAll in interface Collection<E>containsAll in interface Set<E>Set.containsAll(java.util.Collection)public boolean equals(Object o)
equals in interface Collection<E>equals in interface Set<E>equals in class ObjectSet.equals(java.lang.Object)public Spliterator<E> spliterator()
spliterator in interface Iterable<E>spliterator in interface Collection<E>spliterator in interface Set<E>public Stream<E> parallelStream()
parallelStream in interface Collection<E>public Stream<E> stream()
stream in interface Collection<E>public boolean removeIf(Predicate<? super E> filter)
removeIf in interface Collection<E>protected Set<E> getDelegate()
public Set<E> getDelegateObject()
getDelegateObject in interface IndirectCollection<E,Set<E>>public ValueHolderInterface<Set<E>> getValueHolder()
getValueHolder in interface IndirectContainer<Set<E>>public boolean hasBeenRegistered()
public int hashCode()
hashCode in interface Collection<E>hashCode in interface Set<E>hashCode in class ObjectSet.hashCode()public boolean isEmpty()
isEmpty in interface Collection<E>isEmpty in interface Set<E>Set.isEmpty()public boolean isInstantiated()
isInstantiated in interface IndirectContainer<Set<E>>public Iterator<E> iterator()
iterator in interface Iterable<E>iterator in interface Collection<E>iterator in interface Set<E>Set.iterator()public boolean remove(Object element)
remove in interface Collection<E>remove in interface Set<E>Set.remove(java.lang.Object)public boolean removeAll(Collection<?> c)
removeAll in interface Collection<E>removeAll in interface Set<E>Set.removeAll(java.util.Collection)public boolean retainAll(Collection<?> c)
retainAll in interface Collection<E>retainAll in interface Set<E>Set.retainAll(java.util.Collection)public void setValueHolder(ValueHolderInterface<Set<E>> valueHolder)
setValueHolder in interface IndirectContainer<Set<E>>public void setUseLazyInstantiation(boolean useLazyInstantiation)
setUseLazyInstantiation in interface IndirectCollection<E,Set<E>>public int size()
size in interface Collection<E>size in interface Set<E>Set.size()protected boolean shouldUseLazyInstantiation()
public Object[] toArray()
toArray in interface Collection<E>toArray in interface Set<E>Set.toArray()public <T> T[] toArray(T[] a)
toArray in interface Collection<E>toArray in interface Set<E>Set.toArray(java.lang.Object[])public String toString()
toString in class ObjectAbstractCollection.toString()protected void raiseAddChangeEvent(Object element)
protected void raiseRemoveChangeEvent(Object element)
public PropertyChangeListener _persistence_getPropertyChangeListener()
_persistence_getPropertyChangeListener in interface ChangeTrackerpublic boolean hasTrackedPropertyChangeListener()
public void _persistence_setPropertyChangeListener(PropertyChangeListener changeListener)
_persistence_setPropertyChangeListener in interface ChangeTrackerpublic String getTrackedAttributeName()
getTrackedAttributeName in interface CollectionChangeTrackerpublic void setTrackedAttributeName(String attributeName)
setTrackedAttributeName in interface CollectionChangeTrackerpublic Collection<E> getRemovedElements()
getRemovedElements in interface IndirectCollection<E,Set<E>>public Collection<E> getAddedElements()
getAddedElements in interface IndirectCollection<E,Set<E>>public boolean hasAddedElements()
public boolean hasRemovedElements()
public boolean hasDeferredChanges()
hasDeferredChanges in interface IndirectCollection<E,Set<E>>protected boolean shouldAvoidInstantiation()
Copyright © 2007–2021 Eclipse.org - EclipseLink Project. All rights reserved.