E
- the type of elements maintained by this listpublic class IndirectList<E> extends Vector<E> implements CollectionChangeTracker, IndirectCollection<E,List<E>>
To use an IndirectList:
CollectionMapping
,
IndirectMap
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected Vector<E> |
delegate
Reduce type casting.
|
protected int |
initialCapacity
Store initial size for lazy init.
|
protected boolean |
isRegistered
PERF: Quick check flag if has been registered in a unit of work.
|
protected ValueHolderInterface<List<E>> |
valueHolder
Delegate indirection behavior to a value holder.
|
capacityIncrement, elementCount, elementData
modCount
Constructor and Description |
---|
IndirectList()
PUBLIC:
Construct an empty IndirectList so that its internal data array
has size
10 and its standard capacity increment is zero. |
IndirectList(Collection<? extends E> collection)
PUBLIC:
Construct an IndirectList containing the elements of the specified
collection, in the order they are returned by the collection's
iterator.
|
IndirectList(int initialCapacity)
PUBLIC:
Construct an empty IndirectList with the specified initial capacity and
with its capacity increment equal to zero.
|
IndirectList(int initialCapacity,
int capacityIncrement)
PUBLIC:
Construct an empty IndirectList with the specified initial capacity and
capacity increment.
|
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) |
void |
add(int index,
E element) |
boolean |
addAll(Collection<? extends E> c) |
boolean |
addAll(int index,
Collection<? extends E> c) |
void |
addElement(E obj) |
protected Vector<E> |
buildDelegate()
INTERNAL:
Return the freshly-built delegate.
|
int |
capacity() |
void |
clear() |
void |
clearDeferredChanges()
INTERNAL:
clear any changes that have been deferred to instantiation.
|
Object |
clone()
PUBLIC:
|
boolean |
contains(Object element)
PUBLIC:
|
boolean |
containsAll(Collection<?> c) |
void |
copyInto(Object[] anArray) |
E |
elementAt(int index) |
Enumeration<E> |
elements() |
void |
ensureCapacity(int minCapacity) |
boolean |
equals(Object o) |
E |
firstElement() |
void |
forEach(Consumer<? super E> action) |
E |
get(int index) |
List<E> |
getAddedElements()
INTERNAL:
Return the elements that have been added before instantiation.
|
protected Vector<E> |
getDelegate()
INTERNAL:
Check whether the contents have been read from the database.
|
List<E> |
getDelegateObject()
INTERNAL:
Return the real collection object.
|
List<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<List<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 IndirectList has been registered with the UnitOfWork
|
boolean |
hasDeferredChanges()
INTERNAL:
Return if any elements that have been added or removed before instantiation.
|
int |
hashCode()
INTERNAL:
|
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.
|
int |
indexOf(Object elem) |
int |
indexOf(Object elem,
int index) |
void |
insertElementAt(E obj,
int index) |
boolean |
isEmpty() |
boolean |
isInstantiated()
PUBLIC:
Return whether the contents have been read from the database.
|
boolean |
isListOrderBrokenInDb() |
protected boolean |
isRelationshipMaintenanceRequired() |
Iterator<E> |
iterator() |
E |
lastElement() |
int |
lastIndexOf(Object elem) |
int |
lastIndexOf(Object elem,
int index) |
ListIterator<E> |
listIterator() |
ListIterator<E> |
listIterator(int index) |
Stream<E> |
parallelStream() |
protected void |
raiseAddChangeEvent(E element,
Integer index)
Raise the add change event and relationship maintenance.
|
protected void |
raiseAddChangeEvent(E element,
Integer index,
boolean isSet) |
protected void |
raiseRemoveChangeEvent(Object element,
Integer index)
Raise the remove change event.
|
protected void |
raiseRemoveChangeEvent(Object element,
Integer index,
boolean isSet) |
E |
remove(int index) |
boolean |
remove(Object element) |
boolean |
removeAll(Collection<?> c) |
void |
removeAllElements() |
boolean |
removeElement(Object obj) |
void |
removeElementAt(int index) |
boolean |
removeIf(Predicate<? super E> filter) |
void |
replaceAll(UnaryOperator<E> operator) |
boolean |
retainAll(Collection<?> c) |
E |
set(int index,
E element) |
void |
setElementAt(E obj,
int index) |
void |
setIsListOrderBrokenInDb(boolean isBroken) |
void |
setSize(int newSize) |
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<List<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() |
void |
sort(Comparator<? super E> c) |
Spliterator<E> |
spliterator() |
Stream<E> |
stream() |
List<E> |
subList(int fromIndex,
int toIndex) |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
String |
toString()
PUBLIC:
Use the java.util.Vector#toString(); but wrap it with braces to indicate
there is a bit of indirection.
|
void |
trimToSize() |
protected boolean |
usesListOrderField()
INTERNAL:
Returns whether the mapping has listOrderField.
|
removeRange
protected volatile ValueHolderInterface<List<E>> valueHolder
protected int initialCapacity
protected boolean isRegistered
public IndirectList()
10
and its standard capacity increment is zero.public IndirectList(int initialCapacity)
initialCapacity
- the initial capacity of the vectorIllegalArgumentException
- if the specified initial capacity
is negativepublic IndirectList(int initialCapacity, int capacityIncrement)
initialCapacity
- the initial capacity of the vectorcapacityIncrement
- the amount by which the capacity is
increased when the vector overflowsIllegalArgumentException
- if the specified initial capacity
is negativepublic IndirectList(Collection<? extends E> collection)
collection
- a collection containing the elements to construct this IndirectList with.public void add(int index, E element)
protected void raiseAddChangeEvent(E element, Integer index)
protected boolean isRelationshipMaintenanceRequired()
protected void raiseRemoveChangeEvent(Object element, Integer index)
protected void raiseRemoveChangeEvent(Object element, Integer index, boolean isSet)
public boolean add(E element)
add
in interface Collection<E>
add
in interface List<E>
add
in class Vector<E>
Vector.add(java.lang.Object)
public boolean addAll(int index, Collection<? extends E> c)
public boolean addAll(Collection<? extends E> c)
addAll
in interface Collection<E>
addAll
in interface List<E>
addAll
in class Vector<E>
Vector.addAll(java.util.Collection)
public void addElement(E obj)
addElement
in class Vector<E>
Vector.addElement(java.lang.Object)
public int capacity()
capacity
in class Vector<E>
Vector.capacity()
public void clear()
clear
in interface Collection<E>
clear
in interface List<E>
clear
in class Vector<E>
Vector.clear()
public void clearDeferredChanges()
clearDeferredChanges
in interface IndirectCollection<E,List<E>>
public Object clone()
clone
in class Vector<E>
This will result in a database query if necessary.
public boolean contains(Object element)
contains
in interface Collection<E>
contains
in interface List<E>
contains
in class Vector<E>
Vector.contains(java.lang.Object)
public boolean containsAll(Collection<?> c)
containsAll
in interface Collection<E>
containsAll
in interface List<E>
containsAll
in class Vector<E>
Vector.containsAll(java.util.Collection)
public void copyInto(Object[] anArray)
copyInto
in class Vector<E>
Vector.copyInto(java.lang.Object[])
public E elementAt(int index)
elementAt
in class Vector<E>
Vector.elementAt(int)
public Enumeration<E> elements()
elements
in class Vector<E>
Vector.elements()
public void ensureCapacity(int minCapacity)
ensureCapacity
in class Vector<E>
Vector.ensureCapacity(int)
public boolean equals(Object o)
equals
in interface Collection<E>
equals
in interface List<E>
equals
in class Vector<E>
Vector.equals(java.lang.Object)
public E firstElement()
firstElement
in class Vector<E>
Vector.firstElement()
public E get(int index)
protected Vector<E> getDelegate()
public List<E> getDelegateObject()
getDelegateObject
in interface IndirectCollection<E,List<E>>
public ValueHolderInterface<List<E>> getValueHolder()
getValueHolder
in interface IndirectContainer<List<E>>
public boolean hasBeenRegistered()
public int hashCode()
hashCode
in interface Collection<E>
hashCode
in interface List<E>
hashCode
in class Vector<E>
Vector.hashCode()
public int indexOf(Object elem)
public int indexOf(Object elem, int index)
indexOf
in class Vector<E>
Vector.indexOf(java.lang.Object, int)
public void insertElementAt(E obj, int index)
insertElementAt
in class Vector<E>
Vector.insertElementAt(java.lang.Object, int)
public boolean isEmpty()
isEmpty
in interface Collection<E>
isEmpty
in interface List<E>
isEmpty
in class Vector<E>
Vector.isEmpty()
public boolean isInstantiated()
isInstantiated
in interface IndirectContainer<List<E>>
public E lastElement()
lastElement
in class Vector<E>
Vector.lastElement()
public int lastIndexOf(Object elem)
lastIndexOf
in interface List<E>
lastIndexOf
in class Vector<E>
Vector.lastIndexOf(java.lang.Object)
public int lastIndexOf(Object elem, int index)
lastIndexOf
in class Vector<E>
Vector.lastIndexOf(java.lang.Object, int)
public ListIterator<E> listIterator()
listIterator
in interface List<E>
listIterator
in class Vector<E>
AbstractList.listIterator()
public ListIterator<E> listIterator(int index)
listIterator
in interface List<E>
listIterator
in class Vector<E>
AbstractList.listIterator(int)
public E remove(int index)
public boolean remove(Object element)
remove
in interface Collection<E>
remove
in interface List<E>
remove
in class Vector<E>
Vector.remove(java.lang.Object)
public boolean removeAll(Collection<?> c)
removeAll
in interface Collection<E>
removeAll
in interface List<E>
removeAll
in class Vector<E>
Vector.removeAll(java.util.Collection)
public void removeAllElements()
removeAllElements
in class Vector<E>
Vector.removeAllElements()
public boolean removeElement(Object obj)
removeElement
in class Vector<E>
Vector.removeElement(java.lang.Object)
public void removeElementAt(int index)
removeElementAt
in class Vector<E>
Vector.removeElementAt(int)
public boolean retainAll(Collection<?> c)
retainAll
in interface Collection<E>
retainAll
in interface List<E>
retainAll
in class Vector<E>
Vector.retainAll(java.util.Collection)
public void setElementAt(E obj, int index)
setElementAt
in class Vector<E>
Vector.setElementAt(java.lang.Object, int)
public void setSize(int newSize)
setSize
in class Vector<E>
Vector.setSize(int)
public void setUseLazyInstantiation(boolean useLazyInstantiation)
setUseLazyInstantiation
in interface IndirectCollection<E,List<E>>
public void setValueHolder(ValueHolderInterface<List<E>> valueHolder)
setValueHolder
in interface IndirectContainer<List<E>>
public int size()
size
in interface Collection<E>
size
in interface List<E>
size
in class Vector<E>
Vector.size()
protected boolean shouldUseLazyInstantiation()
public Object[] toArray()
toArray
in interface Collection<E>
toArray
in interface List<E>
toArray
in class Vector<E>
Vector.toArray()
public <T> T[] toArray(T[] a)
toArray
in interface Collection<E>
toArray
in interface List<E>
toArray
in class Vector<E>
Vector.toArray(java.lang.Object[])
public Spliterator<E> spliterator()
spliterator
in interface Iterable<E>
spliterator
in interface Collection<E>
spliterator
in interface List<E>
spliterator
in class Vector<E>
public void replaceAll(UnaryOperator<E> operator)
replaceAll
in interface List<E>
replaceAll
in class Vector<E>
public Stream<E> parallelStream()
parallelStream
in interface Collection<E>
public Stream<E> stream()
stream
in interface Collection<E>
public void sort(Comparator<? super E> c)
public String toString()
toString
in class Vector<E>
Vector.toString()
public void trimToSize()
trimToSize
in class Vector<E>
Vector.trimToSize()
public PropertyChangeListener _persistence_getPropertyChangeListener()
_persistence_getPropertyChangeListener
in interface ChangeTracker
public boolean hasTrackedPropertyChangeListener()
public void _persistence_setPropertyChangeListener(PropertyChangeListener changeListener)
_persistence_setPropertyChangeListener
in interface ChangeTracker
public String getTrackedAttributeName()
getTrackedAttributeName
in interface CollectionChangeTracker
public void setTrackedAttributeName(String attributeName)
setTrackedAttributeName
in interface CollectionChangeTracker
public List<E> getRemovedElements()
getRemovedElements
in interface IndirectCollection<E,List<E>>
public List<E> getAddedElements()
getAddedElements
in interface IndirectCollection<E,List<E>>
public boolean hasAddedElements()
public boolean hasRemovedElements()
public boolean hasDeferredChanges()
hasDeferredChanges
in interface IndirectCollection<E,List<E>>
protected boolean shouldAvoidInstantiation()
protected boolean usesListOrderField()
public boolean isListOrderBrokenInDb()
public void setIsListOrderBrokenInDb(boolean isBroken)
Copyright © 2007–2021 Eclipse.org - EclipseLink Project. All rights reserved.