E - the type of the elements in this listpublic class WritableList<E> extends ObservableList<E>
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.
wrappedList| Constructor and Description |
|---|
WritableList()
Creates an empty writable list in the default realm with a
null element type. |
WritableList(java.util.Collection<E> collection,
java.lang.Object elementType)
Constructs a new instance in the default realm containing the elements of
the given collection.
|
WritableList(java.util.List<E> toWrap,
java.lang.Object elementType)
Constructs a new instance with the default realm.
|
WritableList(Realm realm)
Creates an empty writable list with a
null element type. |
WritableList(Realm realm,
java.util.Collection<E> collection,
java.lang.Object elementType)
Constructs a new instance in the default realm containing the elements of
the given collection.
|
WritableList(Realm realm,
java.util.List<E> toWrap,
java.lang.Object elementType)
Creates a writable list containing elements of the given type, wrapping
an existing client-supplied list.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(E element) |
void |
add(int index,
E element) |
boolean |
addAll(java.util.Collection<? extends E> c) |
boolean |
addAll(int index,
java.util.Collection<? extends E> c) |
protected void |
addListener(java.lang.Object listenerType,
IObservablesListener listener) |
void |
clear() |
protected java.lang.Object |
clone() |
protected void |
fireEvent(ObservableEvent event) |
protected void |
firstListenerAdded() |
Realm |
getRealm() |
protected boolean |
hasListeners() |
protected void |
lastListenerRemoved() |
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) |
protected void |
removeListener(java.lang.Object listenerType,
IObservablesListener listener) |
boolean |
retainAll(java.util.Collection<?> c) |
E |
set(int index,
E element) |
static <T> WritableList<T> |
withElementType(java.lang.Object elementType) |
addListChangeListener, contains, containsAll, dispose, equals, fireChange, fireListChange, get, getElementType, getterCalled, hashCode, indexOf, isEmpty, isStale, iterator, lastIndexOf, listIterator, listIterator, removeListChangeListener, setStale, size, subList, toArray, toArray, toString, updateWrappedListaddChangeListener, addDisposeListener, addStaleListener, checkRealm, fireStale, isDisposed, removeChangeListener, removeDisposeListener, removeStaleListenerfinalize, getClass, notify, notifyAll, wait, wait, waitaddChangeListener, addDisposeListener, addStaleListener, getRealm, isDisposed, removeChangeListener, removeDisposeListener, removeStaleListenerpublic WritableList()
null element type.public WritableList(Realm realm)
null element type.realm - the observable's realmpublic WritableList(java.util.List<E> toWrap, java.lang.Object elementType)
WritableList(Collection, Object) should be used by casting the
first argument to Collection.toWrap - The java.util.List to wrapelementType - can be nullpublic WritableList(java.util.Collection<E> collection, java.lang.Object elementType)
collection - the collection to copyelementType - can be nullpublic WritableList(Realm realm, java.util.List<E> toWrap, java.lang.Object elementType)
WritableList(Realm, Collection, Object) should be used by
casting the second argument to Collection.realm - the observable's realmtoWrap - The java.util.List to wrapelementType - can be nullpublic WritableList(Realm realm, java.util.Collection<E> collection, java.lang.Object elementType)
realm - the observable's realmcollection - the collection to copyelementType - can be nullpublic E set(int index, E element)
set in interface java.util.List<E>set in interface IObservableList<E>set in class ObservableList<E>public E move(int oldIndex, int newIndex)
ObservableListoldIndex 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>move in class ObservableList<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().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>remove in class ObservableList<E>public boolean add(E element)
add in interface java.util.Collection<E>add in interface java.util.List<E>add in interface IObservableList<E>add in class ObservableList<E>public void add(int index,
E element)
add in interface java.util.List<E>add in class ObservableList<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>addAll in class ObservableList<E>public boolean addAll(int index,
java.util.Collection<? extends E> c)
addAll in interface java.util.List<E>addAll in interface IObservableList<E>addAll in class ObservableList<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>remove in class ObservableList<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>removeAll in class ObservableList<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>retainAll in class ObservableList<E>public void clear()
clear in interface java.util.Collection<E>clear in interface java.util.List<E>clear in class ObservableList<E>public static <T> WritableList<T> withElementType(java.lang.Object elementType)
elementType - can be nullprotected 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.