java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
org.eclipse.emf.common.util.AbstractEList<E>
org.eclipse.emf.common.util.BasicEList<E>
org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EAdapterList<E>
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<E>,Collection<E>,List<E>,RandomAccess,SequencedCollection<E>,BasicNotifierImpl.EObservableAdapterList,BasicNotifierImpl.EScannableAdapterList,EList<E>
- Enclosing class:
BasicNotifierImpl
public static class BasicNotifierImpl.EAdapterList<E extends Object & Adapter>
extends BasicEList<E>
implements BasicNotifierImpl.EObservableAdapterList, BasicNotifierImpl.EScannableAdapterList
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.emf.common.util.BasicEList
BasicEList.BasicIndexOutOfBoundsException, BasicEList.EIterator<E1>, BasicEList.EListIterator<E1>, BasicEList.FastCompare<E>, BasicEList.NonResolvingEIterator<E1>, BasicEList.NonResolvingEListIterator<E1>, BasicEList.UnmodifiableEList<E>Nested classes/interfaces inherited from interface org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EObservableAdapterList
BasicNotifierImpl.EObservableAdapterList.Listener -
Field Summary
FieldsFields inherited from class org.eclipse.emf.common.util.BasicEList
data, sizeFields inherited from class java.util.AbstractList
modCount -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds the object at the given index in the list.booleanAdds the object at the end of the list and returns whether the object was added; ifuniquenessis required, duplicates will be ignored andfalsewill be returned.booleanaddAll(Collection<? extends E> collection) Adds each object of the collection to the end of the list.voidAdds another listener from the adapter list.protected booleanReturns whethernullis a valid object for the list.voidclear()Clears the list of all objects.Object[]data()Returns direct unsafe access to the underlying data storage.protected voidCalled to indicate that an object has been added to the data storage.protected voidCalled to indicate that an object has been removed from the data storage.protected voidgetAdapterForType(Object type) Returns that first adapter in the list for whichisAdapterForType(type)returntrue.move(int newPosition, int oldPosition) Moves the object at the source index of the list to the target index of the list and returns the moved object.voidMoves the object to the index of the list.protected Object[]newData(int capacity) Returns new allocated data storage.remove(int index) Removes the object at the index from the list and returns it.booleanRemoves the object from the list and returns whether the object was actually contained by the list.booleanremoveAll(Collection<?> collection) Removes each object of the collection from the list and returns whether any object was actually contained by the list.voidRemove the listener from the adapter list.booleanretainAll(Collection<?> collection) Removes from the list each object not contained by the collection and returns whether any object was actually removed.Sets the object at the index and returns the old object at the index.protected booleanReturns whetherequalsrather than==should be used to compare members.Methods inherited from class org.eclipse.emf.common.util.BasicEList
addAllUnique, addAllUnique, addAllUnique, addAllUnique, addUnique, addUnique, assign, basicGet, basicList, clone, contains, get, grow, indexOf, isEmpty, lastIndexOf, primitiveGet, setData, setUnique, shrink, size, toArray, toArrayMethods inherited from class org.eclipse.emf.common.util.AbstractEList
addAll, basicIterator, basicListIterator, basicListIterator, didChange, didClear, didMove, didSet, equalObjects, equals, getDuplicates, getNonDuplicates, hashCode, isUnique, iterator, listIterator, listIterator, resolve, toString, validateMethods inherited from class java.util.AbstractList
removeRange, subListMethods inherited from class java.util.AbstractCollection
containsAllMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
addFirst, addLast, containsAll, getFirst, getLast, removeFirst, removeLast, replaceAll, reversed, sort, spliterator, subList
-
Field Details
-
notifier
-
listeners
-
safe
protected boolean safe
-
-
Constructor Details
-
EAdapterList
-
-
Method Details
-
canContainNull
protected boolean canContainNull()Description copied from class:AbstractEListReturns whethernullis a valid object for the list. The default is to returntrue, but clients can override this to excludenull.- Overrides:
canContainNullin classAbstractEList<E extends Object & Adapter>- Returns:
- whether
nullis a valid object for the list.
-
useEquals
protected boolean useEquals()Description copied from class:AbstractEListReturns whetherequalsrather than==should be used to compare members. The default is to returntruebut clients can optimize performance by returningfalse. The performance difference is highly significant.- Overrides:
useEqualsin classAbstractEList<E extends Object & Adapter>- Returns:
- whether
equalsrather than==should be used.
-
newData
Description copied from class:BasicEListReturns new allocated data storage. Clients may override this to create typed storage. The cost of type checking via a typed array is negligible.- Overrides:
newDatain classBasicEList<E extends Object & Adapter>- Returns:
- new data storage.
-
didAdd
Description copied from class:AbstractEListCalled to indicate that an object has been added to the data storage. This implementation does nothing; clients can use this to monitor additions to the data storage.- Overrides:
didAddin classAbstractEList<E extends Object & Adapter>- Parameters:
index- the position object the new object.newObject- the new object at the position.
-
didRemove
Description copied from class:AbstractEListCalled to indicate that an object has been removed from the data storage. This implementation does nothing; clients can use this to monitor removals from the data storage.- Overrides:
didRemovein classAbstractEList<E extends Object & Adapter>- Parameters:
index- the position of the old object.oldObject- the old object at the position.
-
data
Description copied from class:BasicEListReturns direct unsafe access to the underlying data storage. Clients may not modify this and may not assume that the array remains valid as the list is modified.- Overrides:
datain classBasicEList<E extends Object & Adapter>- Returns:
- direct unsafe access to the underlying data storage.
-
ensureSafety
protected void ensureSafety() -
add
Description copied from class:AbstractEListAdds the object at the end of the list and returns whether the object was added; ifuniquenessis required, duplicates will be ignored andfalsewill be returned. This implementation delegates toaddUnique(E)after uniqueness checking. -
add
Description copied from class:AbstractEListAdds the object at the given index in the list. Ifuniquenessis required, duplicates will be ignored. This implementation delegates toaddUnique(int, E)after uniqueness checking. -
addAll
Description copied from class:AbstractEListAdds each object of the collection to the end of the list. Ifuniquenessis required, duplicates will beremovedfrom the collection, which could even result in an empty collection. This implementation delegates toaddAllUnique(Collection)after uniqueness checking. -
remove
Description copied from class:AbstractEListRemoves the object from the list and returns whether the object was actually contained by the list. This implementation usesindexOfto find the object and delegates toremove(int)in the case that it finds the object.- Specified by:
removein interfaceCollection<E extends Object & Adapter>- Specified by:
removein interfaceList<E extends Object & Adapter>- Overrides:
removein classAbstractEList<E extends Object & Adapter>- Parameters:
object- the object to be removed.- Returns:
- whether the object was actually contained by the list.
-
remove
Description copied from class:BasicEList -
removeAll
Description copied from class:AbstractEListRemoves each object of the collection from the list and returns whether any object was actually contained by the list.- Specified by:
removeAllin interfaceCollection<E extends Object & Adapter>- Specified by:
removeAllin interfaceList<E extends Object & Adapter>- Overrides:
removeAllin classAbstractEList<E extends Object & Adapter>- Parameters:
collection- the collection of objects to be removed.- Returns:
- whether any object was actually contained by the list.
-
clear
public void clear()Description copied from class:BasicEList -
retainAll
Description copied from class:AbstractEListRemoves from the list each object not contained by the collection and returns whether any object was actually removed. This delegates toremove(int)in the case that it finds an object that isn't retained.- Specified by:
retainAllin interfaceCollection<E extends Object & Adapter>- Specified by:
retainAllin interfaceList<E extends Object & Adapter>- Overrides:
retainAllin classAbstractEList<E extends Object & Adapter>- Parameters:
collection- the collection of objects to be retained.- Returns:
- whether any object was actually removed.
-
set
Description copied from class:AbstractEListSets the object at the index and returns the old object at the index. This implementation delegates tosetUniqueafter range checking and afteruniquenesschecking. -
move
Description copied from class:AbstractEListMoves the object to the index of the list. This implementation usesAbstractList.indexOf(java.lang.Object)of find the object and delegates tomove(int, int). -
move
Description copied from class:BasicEList -
addListener
Description copied from interface:BasicNotifierImpl.EObservableAdapterListAdds another listener from the adapter list.- Specified by:
addListenerin interfaceBasicNotifierImpl.EObservableAdapterList- Parameters:
listener- the listener being added.
-
removeListener
Description copied from interface:BasicNotifierImpl.EObservableAdapterListRemove the listener from the adapter list.- Specified by:
removeListenerin interfaceBasicNotifierImpl.EObservableAdapterList- Parameters:
listener- the listener being removed.
-
getAdapterForType
Description copied from interface:BasicNotifierImpl.EScannableAdapterListReturns that first adapter in the list for whichisAdapterForType(type)returntrue.- Specified by:
getAdapterForTypein interfaceBasicNotifierImpl.EScannableAdapterList- Parameters:
type- the type of adapter to get.- Returns:
- the first adapter in the list for which
isAdapterForType(Object)returntrue, ornullif there isn't one. - Since:
- 2.15
-