public class WritableList extends ObservableList
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(Collection collection,
Object elementType)
Constructs a new instance in the default realm containing the elements of
the given collection.
|
WritableList(List toWrap,
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,
Collection collection,
Object elementType)
Constructs a new instance in the default realm containing the elements of
the given collection.
|
WritableList(Realm realm,
List toWrap,
Object elementType)
Creates a writable list containing elements of the given type, wrapping
an existing client-supplied list.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
Object element) |
boolean |
add(Object element) |
boolean |
addAll(Collection c) |
boolean |
addAll(int index,
Collection c) |
protected void |
addListener(Object listenerType,
IObservablesListener listener) |
void |
clear() |
protected Object |
clone() |
protected void |
fireEvent(ObservableEvent event) |
protected void |
firstListenerAdded() |
Realm |
getRealm() |
protected boolean |
hasListeners() |
protected void |
lastListenerRemoved() |
Object |
move(int oldIndex,
int newIndex)
Moves the element located at
oldIndex to
newIndex. |
Object |
remove(int index) |
boolean |
remove(Object o) |
boolean |
removeAll(Collection c) |
protected void |
removeListener(Object listenerType,
IObservablesListener listener) |
boolean |
retainAll(Collection c) |
Object |
set(int index,
Object element) |
static WritableList |
withElementType(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(List toWrap, 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(Collection collection, Object elementType)
collection - the collection to copyelementType - can be nullpublic WritableList(Realm realm, List toWrap, 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, Collection collection, Object elementType)
realm - the observable's realmcollection - the collection to copyelementType - can be nullpublic Object set(int index, Object element)
set in interface Listset in interface IObservableListset in class ObservableListpublic Object 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 IObservableListmove in class ObservableListoldIndex - 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 Object remove(int index)
remove in interface Listremove in interface IObservableListremove in class ObservableListpublic boolean add(Object element)
add in interface Collectionadd in interface Listadd in interface IObservableListadd in class ObservableListpublic void add(int index,
Object element)
add in interface Listadd in class ObservableListpublic boolean addAll(Collection c)
addAll in interface CollectionaddAll in interface ListaddAll in interface IObservableListaddAll in class ObservableListpublic boolean addAll(int index,
Collection c)
addAll in interface ListaddAll in interface IObservableListaddAll in class ObservableListpublic boolean remove(Object o)
remove in interface Collectionremove in interface Listremove in interface IObservableListremove in class ObservableListpublic boolean removeAll(Collection c)
removeAll in interface CollectionremoveAll in interface ListremoveAll in interface IObservableListremoveAll in class ObservableListpublic boolean retainAll(Collection c)
retainAll in interface CollectionretainAll in interface ListretainAll in interface IObservableListretainAll in class ObservableListpublic void clear()
clear in interface Collectionclear in interface Listclear in class ObservableListpublic static WritableList withElementType(Object elementType)
elementType - can be nullprotected void addListener(Object listenerType, IObservablesListener listener)
listenerType - listener - protected void removeListener(Object listenerType, IObservablesListener listener)
listenerType - listener - protected boolean hasListeners()
protected void fireEvent(ObservableEvent event)
protected void firstListenerAdded()
protected void lastListenerRemoved()
public Realm getRealm()
protected Object clone() throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedException
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.