E - the type of the elements in this listpublic abstract class ObservableList<E> extends AbstractObservable implements IObservableList<E>
IObservableList, based on an underlying
regular list.
This class is thread safe. All state accessing methods must be invoked from
the current realm. Methods for adding and removing
listeners may be invoked from any thread.
| Modifier and Type | Field and Description |
|---|---|
protected java.util.List<E> |
wrappedList |
| Modifier | Constructor and Description |
|---|---|
protected |
ObservableList(java.util.List<E> wrappedList,
java.lang.Object elementType) |
protected |
ObservableList(Realm realm,
java.util.List<E> wrappedList,
java.lang.Object elementType) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E o) |
void |
add(int index,
E element) |
boolean |
addAll(java.util.Collection<? extends E> c) |
boolean |
addAll(int index,
java.util.Collection<? extends E> c) |
void |
addListChangeListener(IListChangeListener<? super E> listener)
Adds the given list change listener to the list of list change listeners.
|
protected void |
addListener(java.lang.Object listenerType,
IObservablesListener listener) |
void |
clear() |
protected java.lang.Object |
clone() |
boolean |
contains(java.lang.Object o) |
boolean |
containsAll(java.util.Collection<?> c) |
void |
dispose()
Disposes of this observable object, removing all listeners registered
with this object, and all listeners this object might have registered on
other objects.
|
boolean |
equals(java.lang.Object o) |
protected void |
fireChange() |
protected void |
fireEvent(ObservableEvent event) |
protected void |
fireListChange(ListDiff<E> diff) |
protected void |
firstListenerAdded() |
E |
get(int index) |
java.lang.Object |
getElementType()
Returns the element type of this observable collection, or
null if this observable collection is untyped. |
Realm |
getRealm() |
protected void |
getterCalled() |
int |
hashCode() |
protected boolean |
hasListeners() |
int |
indexOf(java.lang.Object o) |
boolean |
isEmpty() |
boolean |
isStale()
Returns the stale state.
|
java.util.Iterator<E> |
iterator() |
int |
lastIndexOf(java.lang.Object o) |
protected void |
lastListenerRemoved() |
java.util.ListIterator<E> |
listIterator() |
java.util.ListIterator<E> |
listIterator(int index) |
E |
move(int oldIndex,
int newIndex)
Moves the element located at
oldIndex to
newIndex. |
E |
remove(int index) |
boolean |
remove(java.lang.Object o) |
boolean |
removeAll(java.util.Collection<?> c) |
void |
removeListChangeListener(IListChangeListener<? super E> listener)
Removes the given list change listener from the list of list change
listeners.
|
protected void |
removeListener(java.lang.Object listenerType,
IObservablesListener listener) |
boolean |
retainAll(java.util.Collection<?> c) |
E |
set(int index,
E element) |
void |
setStale(boolean stale)
Sets the stale state.
|
int |
size() |
java.util.List<E> |
subList(int fromIndex,
int toIndex) |
java.lang.Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
java.lang.String |
toString() |
protected void |
updateWrappedList(java.util.List<E> newList) |
addChangeListener, addDisposeListener, addStaleListener, checkRealm, fireStale, isDisposed, removeChangeListener, removeDisposeListener, removeStaleListenerfinalize, getClass, notify, notifyAll, wait, wait, waitaddChangeListener, addDisposeListener, addStaleListener, getRealm, isDisposed, removeChangeListener, removeDisposeListener, removeStaleListenerprotected java.util.List<E> wrappedList
protected ObservableList(java.util.List<E> wrappedList, java.lang.Object elementType)
public void addListChangeListener(IListChangeListener<? super E> listener)
IObservableListaddListChangeListener in interface IObservableList<E>public void removeListChangeListener(IListChangeListener<? super E> listener)
IObservableListremoveListChangeListener in interface IObservableList<E>public boolean contains(java.lang.Object o)
contains in interface java.util.Collection<E>contains in interface java.util.List<E>contains in interface IObservableList<E>public boolean containsAll(java.util.Collection<?> c)
containsAll in interface java.util.Collection<E>containsAll in interface java.util.List<E>containsAll in interface IObservableList<E>public boolean equals(java.lang.Object o)
equals in interface java.util.Collection<E>equals in interface java.util.List<E>equals in interface IObservableList<E>equals in class java.lang.Objectpublic int hashCode()
hashCode in interface java.util.Collection<E>hashCode in interface java.util.List<E>hashCode in interface IObservableList<E>hashCode in class java.lang.Objectpublic boolean isEmpty()
isEmpty in interface java.util.Collection<E>isEmpty in interface java.util.List<E>isEmpty in interface IObservableList<E>public java.util.Iterator<E> iterator()
public int size()
size in interface java.util.Collection<E>size in interface java.util.List<E>size in interface IObservableList<E>public java.lang.Object[] toArray()
toArray in interface java.util.Collection<E>toArray in interface java.util.List<E>toArray in interface IObservableList<E>public <T> T[] toArray(T[] a)
toArray in interface java.util.Collection<E>toArray in interface java.util.List<E>toArray in interface IObservableList<E>public java.lang.String toString()
toString in class java.lang.Objectpublic E get(int index)
get in interface java.util.List<E>get in interface IObservableList<E>public int indexOf(java.lang.Object o)
indexOf in interface java.util.List<E>indexOf in interface IObservableList<E>public int lastIndexOf(java.lang.Object o)
lastIndexOf in interface java.util.List<E>lastIndexOf in interface IObservableList<E>public java.util.ListIterator<E> listIterator()
listIterator in interface java.util.List<E>listIterator in interface IObservableList<E>public java.util.ListIterator<E> listIterator(int index)
listIterator in interface java.util.List<E>listIterator in interface IObservableList<E>public java.util.List<E> subList(int fromIndex, int toIndex)
subList in interface java.util.List<E>subList in interface IObservableList<E>protected void getterCalled()
public E set(int index, E element)
set in interface java.util.List<E>set in interface IObservableList<E>public E move(int oldIndex, int newIndex)
oldIndex to
newIndex. This method is equivalent to calling
add(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.
move in interface IObservableList<E>oldIndex - the element's position before the move. Must be within the
range 0 <= oldIndex < size().newIndex - the element's position after the move. Must be within the
range 0 <= newIndex < size().java.lang.IndexOutOfBoundsException - if either argument is out of range (
0 <= index < size()).ListDiffVisitor.handleMove(int, int, Object),
ListDiff.accept(ListDiffVisitor)public E remove(int index)
remove in interface java.util.List<E>remove in interface IObservableList<E>public boolean add(E o)
add in interface java.util.Collection<E>add in interface java.util.List<E>add in interface IObservableList<E>public boolean addAll(java.util.Collection<? extends E> c)
addAll in interface java.util.Collection<E>addAll in interface java.util.List<E>addAll in interface IObservableList<E>public boolean addAll(int index,
java.util.Collection<? extends E> c)
addAll in interface java.util.List<E>addAll in interface IObservableList<E>public boolean remove(java.lang.Object o)
remove in interface java.util.Collection<E>remove in interface java.util.List<E>remove in interface IObservableList<E>public boolean removeAll(java.util.Collection<?> c)
removeAll in interface java.util.Collection<E>removeAll in interface java.util.List<E>removeAll in interface IObservableList<E>public boolean retainAll(java.util.Collection<?> c)
retainAll in interface java.util.Collection<E>retainAll in interface java.util.List<E>retainAll in interface IObservableList<E>public void clear()
public boolean isStale()
isStale in interface IObservablepublic void setStale(boolean stale)
stale - The stale state to list. This will fire a stale event if the
given boolean is true and this observable list was not already
stale.protected void fireChange()
fireChange in class AbstractObservablepublic void dispose()
IObservabledispose in interface IObservabledispose in class AbstractObservablepublic java.lang.Object getElementType()
IObservableCollectionnull if this observable collection is untyped.getElementType in interface IObservableCollection<E>getElementType in interface IObservableList<E>null if untypedprotected void updateWrappedList(java.util.List<E> newList)
protected void addListener(java.lang.Object listenerType,
IObservablesListener listener)
listenerType - listener - protected void removeListener(java.lang.Object listenerType,
IObservablesListener listener)
listenerType - listener - protected boolean hasListeners()
protected void fireEvent(ObservableEvent event)
protected void firstListenerAdded()
protected void lastListenerRemoved()
public Realm getRealm()
protected java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedException
Copyright (c) 2000, 2018 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.