Interface IObservableList<E>
-
- Type Parameters:
E- the type of elements in this collection
- All Superinterfaces:
Collection<E>,IObservable,IObservableCollection<E>,Iterable<E>,List<E>
- All Known Subinterfaces:
ISWTObservableList<E>,IViewerObservableList<E>
- All Known Implementing Classes:
AbstractObservableList,ComputedList,DecoratingObservableList,MultiList,ObservableList,WritableList
public interface IObservableList<E> extends List<E>, IObservableCollection<E>
A list whose changes can be tracked by list change listeners.- Since:
- 1.0
- See Also:
AbstractObservableList,ObservableList- Restriction:
- This interface is not intended to be implemented by clients. Clients should instead subclass one of the framework classes that implement this interface. Note that direct implementers of this interface outside of the framework will be broken in future releases when methods are added to this interface.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanadd(E o)booleanaddAll(int index, Collection<? extends E> c)booleanaddAll(Collection<? extends E> c)voidaddListChangeListener(IListChangeListener<? super E> listener)Adds the given list change listener to the list of list change listeners.booleancontains(Object o)booleancontainsAll(Collection<?> c)booleanequals(Object o)Eget(int index)ObjectgetElementType()Returns the element type of this observable collection, ornullif this observable collection is untyped.inthashCode()intindexOf(Object o)booleanisEmpty()Iterator<E>iterator()intlastIndexOf(Object o)ListIterator<E>listIterator()ListIterator<E>listIterator(int index)Emove(int oldIndex, int newIndex)Moves the element located atoldIndextonewIndex.Eremove(int index)booleanremove(Object o)booleanremoveAll(Collection<?> c)voidremoveListChangeListener(IListChangeListener<? super E> listener)Removes the given list change listener from the list of list change listeners.booleanretainAll(Collection<?> c)Eset(int index, E element)intsize()List<E>subList(int fromIndex, int toIndex)Object[]toArray()<T> T[]toArray(T[] a)-
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
-
Methods inherited from interface org.eclipse.core.databinding.observable.IObservable
addChangeListener, addDisposeListener, addStaleListener, dispose, getRealm, isDisposed, isStale, removeChangeListener, removeDisposeListener, removeStaleListener
-
Methods inherited from interface java.util.List
add, clear, replaceAll, sort, spliterator
-
-
-
-
Method Detail
-
addListChangeListener
void addListChangeListener(IListChangeListener<? super E> listener)
Adds the given list change listener to the list of list change listeners.- Parameters:
listener-
-
removeListChangeListener
void removeListChangeListener(IListChangeListener<? super E> listener)
Removes the given list change listener from the list of list change listeners. Has no effect if the given listener is not registered as a list change listener.- Parameters:
listener-
-
size
int size()
-
isEmpty
boolean isEmpty()
-
contains
boolean contains(Object o)
-
toArray
Object[] toArray()
-
toArray
<T> T[] toArray(T[] a)
-
add
boolean add(E o)
-
remove
boolean remove(Object o)
-
containsAll
boolean containsAll(Collection<?> c)
- Specified by:
containsAllin interfaceCollection<E>- Specified by:
containsAllin interfaceList<E>- "TrackedGetter"
-
addAll
boolean addAll(Collection<? extends E> c)
-
addAll
boolean addAll(int index, Collection<? extends E> c)
-
removeAll
boolean removeAll(Collection<?> c)
-
retainAll
boolean retainAll(Collection<?> c)
-
equals
boolean equals(Object o)
-
hashCode
int hashCode()
-
move
E move(int oldIndex, int newIndex)
Moves the element located atoldIndextonewIndex. This method is equivalent to callingadd(newIndex, remove(oldIndex)).Implementors should 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.- 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.
- Throws:
IndexOutOfBoundsException- if either argument is out of range (0 <= index < size()).- Since:
- 1.1
- See Also:
ListDiffVisitor.handleMove(int, int, Object),ListDiff.accept(ListDiffVisitor)
-
lastIndexOf
int lastIndexOf(Object o)
- Specified by:
lastIndexOfin interfaceList<E>- "TrackedGetter"
-
listIterator
ListIterator<E> listIterator()
- Specified by:
listIteratorin interfaceList<E>- "TrackedGetter"
-
listIterator
ListIterator<E> listIterator(int index)
- Specified by:
listIteratorin interfaceList<E>- "TrackedGetter"
-
getElementType
Object getElementType()
Description copied from interface:IObservableCollectionReturns the element type of this observable collection, ornullif this observable collection is untyped.- Specified by:
getElementTypein interfaceIObservableCollection<E>- Returns:
- the type of the elements or
nullif untyped
-
-