public abstract class ObservableList extends AbstractObservable implements IObservableList
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 List |
wrappedList |
| Modifier | Constructor and Description |
|---|---|
protected |
ObservableList(List wrappedList,
Object elementType) |
protected |
ObservableList(Realm realm,
List wrappedList,
Object elementType) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(int index,
Object element) |
boolean |
add(Object o) |
boolean |
addAll(Collection c) |
boolean |
addAll(int index,
Collection c) |
void |
addListChangeListener(IListChangeListener listener)
Adds the given list change listener to the list of list change listeners.
|
protected void |
addListener(Object listenerType,
IObservablesListener listener) |
void |
clear() |
protected Object |
clone() |
boolean |
contains(Object o) |
boolean |
containsAll(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(Object o) |
protected void |
fireChange() |
protected void |
fireEvent(ObservableEvent event) |
protected void |
fireListChange(ListDiff diff) |
protected void |
firstListenerAdded() |
Object |
get(int index) |
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(Object o) |
boolean |
isEmpty() |
boolean |
isStale()
Returns the stale state.
|
Iterator |
iterator() |
int |
lastIndexOf(Object o) |
protected void |
lastListenerRemoved() |
ListIterator |
listIterator() |
ListIterator |
listIterator(int index) |
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) |
void |
removeListChangeListener(IListChangeListener listener)
Removes the given list change listener from the list of list change listeners.
|
protected void |
removeListener(Object listenerType,
IObservablesListener listener) |
boolean |
retainAll(Collection c) |
Object |
set(int index,
Object element) |
void |
setStale(boolean stale)
Sets the stale state.
|
int |
size() |
List |
subList(int fromIndex,
int toIndex) |
Object[] |
toArray() |
Object[] |
toArray(Object[] a) |
String |
toString() |
protected void |
updateWrappedList(List newList) |
addChangeListener, addDisposeListener, addStaleListener, checkRealm, fireStale, isDisposed, removeChangeListener, removeDisposeListener, removeStaleListenerfinalize, getClass, notify, notifyAll, wait, wait, waitaddChangeListener, addDisposeListener, addStaleListener, getRealm, isDisposed, removeChangeListener, removeDisposeListener, removeStaleListenerprotected List wrappedList
public void addListChangeListener(IListChangeListener listener)
IObservableListaddListChangeListener in interface IObservableListpublic void removeListChangeListener(IListChangeListener listener)
IObservableListremoveListChangeListener in interface IObservableListprotected void fireListChange(ListDiff diff)
public boolean contains(Object o)
contains in interface Collectioncontains in interface Listcontains in interface IObservableListpublic boolean containsAll(Collection c)
containsAll in interface CollectioncontainsAll in interface ListcontainsAll in interface IObservableListpublic boolean equals(Object o)
equals in interface Collectionequals in interface Listequals in interface IObservableListequals in class Objectpublic int hashCode()
hashCode in interface CollectionhashCode in interface ListhashCode in interface IObservableListhashCode in class Objectpublic boolean isEmpty()
isEmpty in interface CollectionisEmpty in interface ListisEmpty in interface IObservableListpublic Iterator iterator()
iterator in interface Iterableiterator in interface Collectioniterator in interface Listiterator in interface IObservableListpublic int size()
size in interface Collectionsize in interface Listsize in interface IObservableListpublic Object[] toArray()
toArray in interface CollectiontoArray in interface ListtoArray in interface IObservableListpublic Object[] toArray(Object[] a)
toArray in interface CollectiontoArray in interface ListtoArray in interface IObservableListpublic Object get(int index)
get in interface Listget in interface IObservableListpublic int indexOf(Object o)
indexOf in interface ListindexOf in interface IObservableListpublic int lastIndexOf(Object o)
lastIndexOf in interface ListlastIndexOf in interface IObservableListpublic ListIterator listIterator()
listIterator in interface ListlistIterator in interface IObservableListpublic ListIterator listIterator(int index)
listIterator in interface ListlistIterator in interface IObservableListpublic List subList(int fromIndex, int toIndex)
subList in interface ListsubList in interface IObservableListprotected void getterCalled()
public Object set(int index, Object element)
set in interface Listset in interface IObservableListpublic Object 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 IObservableListoldIndex - 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().IndexOutOfBoundsException - if either argument is out of range (
0 <= index < size()).ListDiffVisitor.handleMove(int, int, Object),
ListDiff.accept(ListDiffVisitor)public Object remove(int index)
remove in interface Listremove in interface IObservableListpublic boolean add(Object o)
add in interface Collectionadd in interface Listadd in interface IObservableListpublic boolean addAll(Collection c)
addAll in interface CollectionaddAll in interface ListaddAll in interface IObservableListpublic boolean addAll(int index,
Collection c)
addAll in interface ListaddAll in interface IObservableListpublic boolean remove(Object o)
remove in interface Collectionremove in interface Listremove in interface IObservableListpublic boolean removeAll(Collection c)
removeAll in interface CollectionremoveAll in interface ListremoveAll in interface IObservableListpublic boolean retainAll(Collection c)
retainAll in interface CollectionretainAll in interface ListretainAll in interface IObservableListpublic void clear()
clear in interface Collectionclear in interface Listpublic 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 Object getElementType()
IObservableCollectionnull if this observable collection is untyped.getElementType in interface IObservableCollectiongetElementType in interface IObservableListnull if untypedprotected void updateWrappedList(List newList)
protected 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.