Class MultiList<E>
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList<E>
org.eclipse.core.databinding.observable.list.AbstractObservableList<E>
org.eclipse.core.databinding.observable.list.MultiList<E>
- Type Parameters:
E- the type of the elements in the list
- All Implemented Interfaces:
Iterable<E>,Collection<E>,List<E>,SequencedCollection<E>,IObservable,IObservableCollection<E>,IObservableList<E>
An observable list backed by an array of observable lists. This class
supports all removal methods (including
clear()), as well as the
set(int, Object) method. All other mutator methods (addition methods
and move(int, int)) throw an UnsupportedOperationException.- Since:
- 1.2
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionMultiList(List<IObservableList<E>> lists) Constructs a MultiList in the default realm, and backed by the given observable lists.MultiList(List<IObservableList<E>> lists, Object elementType) Constructs a MultiList in the default realm backed by the given observable lists.MultiList(IObservableList<E>[] lists) Deprecated.MultiList(IObservableList<E>[] lists, Object elementType) Deprecated.useMultiList(List, Object)insteadConstructs a MultiList belonging to the given realm, and backed by the given observable lists.MultiList(Realm realm, IObservableList<E>[] lists) Constructs a MultiList belonging to the given realm, and backed by the given observable lists.MultiList(Realm realm, IObservableList<E>[] lists, Object elementType) Deprecated.useMultiList(Realm, List, Object)instead -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleanbooleanaddAll(int index, Collection<? extends E> c) booleanaddAll(Collection<? extends E> c) voidclear()booleanvoiddispose()Disposes of this observable object, removing all listeners registered with this object, and all listeners this object might have registered on other objects.protected intbooleanprotected voidget(int index) Returns the element type of this observable collection, ornullif this observable collection is untyped.inthashCode()intbooleanisEmpty()booleanisStale()Returns whether the state of this observable is stale and is expected to change soon.iterator()intprotected voidlistIterator(int index) move(int oldIndex, int newIndex) Moves the element located atoldIndextonewIndex.remove(int index) booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) Methods inherited from class org.eclipse.core.databinding.observable.list.AbstractObservableList
addChangeListener, addDisposeListener, addListChangeListener, addStaleListener, checkRealm, containsAll, fireChange, fireListChange, fireStale, getRealm, hasListeners, isDisposed, removeChangeListener, removeDisposeListener, removeListChangeListener, removeStaleListener, size, toArray, toArrayMethods inherited from class java.util.AbstractList
listIterator, removeRange, subListMethods inherited from class java.util.AbstractCollection
toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface org.eclipse.core.databinding.observable.list.IObservableList
listIterator, subListMethods inherited from interface java.util.List
addFirst, addLast, getFirst, getLast, removeFirst, removeLast, replaceAll, reversed, sort, spliterator
-
Constructor Details
-
MultiList
Deprecated.useMultiList(List)insteadConstructs a MultiList in the default realm, and backed by the given observable lists.- Parameters:
lists- the array of observable lists backing this MultiList.
-
MultiList
Constructs a MultiList in the default realm, and backed by the given observable lists.- Parameters:
lists- the array of observable lists backing this MultiList.- Since:
- 1.6
-
MultiList
Deprecated.useMultiList(List, Object)insteadConstructs a MultiList in the default realm backed by the given observable lists.- Parameters:
lists- the array of observable lists backing this MultiList.elementType- element type of the constructed list.
-
MultiList
Constructs a MultiList in the default realm backed by the given observable lists.- Parameters:
lists- the array of observable lists backing this MultiList.elementType- element type of the constructed list.- Since:
- 1.6
-
MultiList
Constructs a MultiList belonging to the given realm, and backed by the given observable lists.- Parameters:
realm- the observable's realmlists- the array of observable lists backing this MultiList
-
MultiList
Deprecated.useMultiList(Realm, List, Object)insteadConstructs a MultiList belonging to the given realm, and backed by the given observable lists.- Parameters:
realm- the observable's realmlists- the array of observable lists backing this MultiListelementType- element type of the constructed list.
-
MultiList
Constructs a MultiList belonging to the given realm, and backed by the given observable lists.- Parameters:
realm- the observable's realmlists- the array of observable lists backing this MultiListelementType- element type of the constructed list.- Since:
- 1.6
-
-
Method Details
-
firstListenerAdded
protected void firstListenerAdded()- Overrides:
firstListenerAddedin classAbstractObservableList<E>
-
lastListenerRemoved
protected void lastListenerRemoved()- Overrides:
lastListenerRemovedin classAbstractObservableList<E>
-
doGetSize
protected int doGetSize()- Specified by:
doGetSizein classAbstractObservableList<E>- Returns:
- the size
-
getElementType
Description copied from interface:IObservableCollectionReturns the element type of this observable collection, ornullif this observable collection is untyped.- Returns:
- the type of the elements or
nullif untyped
-
add
- Specified by:
addin interfaceCollection<E>- Specified by:
addin interfaceIObservableList<E>- Specified by:
addin interfaceList<E>- Overrides:
addin classAbstractObservableList<E>
-
add
-
addAll
- Specified by:
addAllin interfaceCollection<E>- Specified by:
addAllin interfaceIObservableList<E>- Specified by:
addAllin interfaceList<E>- Overrides:
addAllin classAbstractObservableList<E>
-
addAll
- Specified by:
addAllin interfaceIObservableList<E>- Specified by:
addAllin interfaceList<E>- Overrides:
addAllin classAbstractObservableList<E>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<E>- Specified by:
clearin interfaceList<E>- Overrides:
clearin classAbstractList<E>
-
get
- Specified by:
getin interfaceIObservableList<E>- Specified by:
getin interfaceList<E>- Specified by:
getin classAbstractList<E>
-
contains
- Specified by:
containsin interfaceCollection<E>- Specified by:
containsin interfaceIObservableList<E>- Specified by:
containsin interfaceList<E>- Overrides:
containsin classAbstractObservableList<E>
-
equals
- Specified by:
equalsin interfaceCollection<E>- Specified by:
equalsin interfaceIObservableList<E>- Specified by:
equalsin interfaceList<E>- Overrides:
equalsin classAbstractObservableList<E>
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<E>- Specified by:
hashCodein interfaceIObservableList<E>- Specified by:
hashCodein interfaceList<E>- Overrides:
hashCodein classAbstractObservableList<E>
-
indexOf
- Specified by:
indexOfin interfaceIObservableList<E>- Specified by:
indexOfin interfaceList<E>- Overrides:
indexOfin classAbstractObservableList<E>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<E>- Specified by:
isEmptyin interfaceIObservableList<E>- Specified by:
isEmptyin interfaceList<E>- Overrides:
isEmptyin classAbstractObservableList<E>
-
iterator
- Specified by:
iteratorin interfaceCollection<E>- Specified by:
iteratorin interfaceIObservableList<E>- Specified by:
iteratorin interfaceIterable<E>- Specified by:
iteratorin interfaceList<E>- Overrides:
iteratorin classAbstractObservableList<E>
-
lastIndexOf
- Specified by:
lastIndexOfin interfaceIObservableList<E>- Specified by:
lastIndexOfin interfaceList<E>- Overrides:
lastIndexOfin classAbstractObservableList<E>
-
listIterator
- Specified by:
listIteratorin interfaceIObservableList<E>- Specified by:
listIteratorin interfaceList<E>- Overrides:
listIteratorin classAbstractList<E>
-
move
Description copied from class:AbstractObservableListMoves the element located atoldIndextonewIndex. This method is equivalent to callingadd(newIndex, remove(oldIndex)).Subclasses should override this method to deliver list change notification for the remove and add operations in the same ListChangeEvent, as this allows
ListDiff.accept(ListDiffVisitor)to recognize the operation as a move.- Specified by:
movein interfaceIObservableList<E>- Overrides:
movein classAbstractObservableList<E>- Parameters:
oldIndex- the element's position before the move. Must be within the range0 <= oldIndex < size().newIndex- the element's position after the move. Must be within the range0 <= newIndex < size().- Returns:
- the element that was moved.
- See Also:
-
remove
- Specified by:
removein interfaceCollection<E>- Specified by:
removein interfaceIObservableList<E>- Specified by:
removein interfaceList<E>- Overrides:
removein classAbstractObservableList<E>
-
remove
- Specified by:
removein interfaceIObservableList<E>- Specified by:
removein interfaceList<E>- Overrides:
removein classAbstractList<E>
-
removeAll
- Specified by:
removeAllin interfaceCollection<E>- Specified by:
removeAllin interfaceIObservableList<E>- Specified by:
removeAllin interfaceList<E>- Overrides:
removeAllin classAbstractObservableList<E>
-
retainAll
- Specified by:
retainAllin interfaceCollection<E>- Specified by:
retainAllin interfaceIObservableList<E>- Specified by:
retainAllin interfaceList<E>- Overrides:
retainAllin classAbstractObservableList<E>
-
set
- Specified by:
setin interfaceIObservableList<E>- Specified by:
setin interfaceList<E>- Overrides:
setin classAbstractList<E>
-
isStale
public boolean isStale()Description copied from interface:IObservableReturns whether the state of this observable is stale and is expected to change soon. A non-stale observable that becomes stale will notify its stale listeners. A stale object that becomes non-stale does so by changing its state and notifying its change listeners, it does not notify its stale listeners about becoming non-stale. Clients that do not expect asynchronous changes may ignore staleness of observable objects.- Specified by:
isStalein interfaceIObservable- Overrides:
isStalein classAbstractObservableList<E>- Returns:
- true if this observable's state is stale and will change soon.
-
dispose
public void dispose()Description copied from interface:IObservableDisposes of this observable object, removing all listeners registered with this object, and all listeners this object might have registered on other objects.- Specified by:
disposein interfaceIObservable- Overrides:
disposein classAbstractObservableList<E>
-
MultiList(List)instead