public abstract class AbstractObservableList extends AbstractList implements IObservableList
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.
modCount| Constructor and Description |
|---|
AbstractObservableList() |
AbstractObservableList(Realm realm) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
add(Object o) |
boolean |
addAll(Collection c) |
boolean |
addAll(int index,
Collection c) |
void |
addChangeListener(IChangeListener listener)
Adds the given change listener to the list of change listeners.
|
void |
addDisposeListener(IDisposeListener listener)
Adds the given dispose listener to the list of dispose listeners.
|
void |
addListChangeListener(IListChangeListener listener)
Adds the given list change listener to the list of list change listeners.
|
void |
addStaleListener(IStaleListener listener)
Adds the given stale listener to the list of stale listeners.
|
protected void |
checkRealm()
Asserts that the realm is the current realm.
|
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.
|
protected abstract int |
doGetSize() |
boolean |
equals(Object o) |
protected void |
fireChange()
Fires change event.
|
protected void |
fireListChange(ListDiff diff) |
protected void |
fireStale()
Fires stale event.
|
protected void |
firstListenerAdded() |
Realm |
getRealm()
Returns the realm for this observable.
|
int |
hashCode() |
protected boolean |
hasListeners()
Returns whether this observable list has any registered listeners.
|
int |
indexOf(Object o) |
boolean |
isDisposed()
Returns whether the observable has been disposed
|
boolean |
isEmpty() |
boolean |
isStale()
Returns whether the state of this observable is stale and is expected to
change soon.
|
Iterator |
iterator() |
int |
lastIndexOf(Object o) |
protected void |
lastListenerRemoved() |
Object |
move(int oldIndex,
int newIndex)
Moves the element located at
oldIndex to
newIndex. |
boolean |
remove(Object o) |
boolean |
removeAll(Collection c) |
void |
removeChangeListener(IChangeListener listener)
Removes the given change listener from the list of change listeners.
|
void |
removeDisposeListener(IDisposeListener listener)
Removes the given dispose listener from the list of dispose listeners.
|
void |
removeListChangeListener(IListChangeListener listener)
Removes the given list change listener from the list of list change listeners.
|
void |
removeStaleListener(IStaleListener listener)
Removes the given stale listener from the list of stale listeners.
|
boolean |
retainAll(Collection c) |
int |
size() |
Object[] |
toArray() |
Object[] |
toArray(Object[] a) |
add, clear, get, listIterator, listIterator, remove, removeRange, set, subListtoStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitget, getElementType, listIterator, listIterator, remove, set, subListpublic AbstractObservableList(Realm realm)
realm - public AbstractObservableList()
protected boolean hasListeners()
public boolean isStale()
IObservableisStale in interface IObservablepublic void addListChangeListener(IListChangeListener listener)
IObservableListaddListChangeListener in interface IObservableListpublic void removeListChangeListener(IListChangeListener listener)
IObservableListremoveListChangeListener in interface IObservableListprotected void fireListChange(ListDiff diff)
public void addChangeListener(IChangeListener listener)
IObservableaddChangeListener in interface IObservablepublic void removeChangeListener(IChangeListener listener)
IObservableremoveChangeListener in interface IObservablepublic void addStaleListener(IStaleListener listener)
IObservableaddStaleListener in interface IObservableIObservable.isStale()public void removeStaleListener(IStaleListener listener)
IObservableremoveStaleListener in interface IObservablepublic void addDisposeListener(IDisposeListener listener)
IObservableaddDisposeListener in interface IObservablelistener - the listener to addpublic void removeDisposeListener(IDisposeListener listener)
IObservableremoveDisposeListener in interface IObservablelistener - the listener to removeprotected void fireChange()
protected void fireStale()
protected void firstListenerAdded()
protected void lastListenerRemoved()
public boolean isDisposed()
IObservableisDisposed in interface IObservablepublic void dispose()
IObservabledispose in interface IObservablepublic final int size()
size in interface Collectionsize in interface Listsize in interface IObservableListsize in class AbstractCollectionprotected abstract int doGetSize()
public boolean isEmpty()
isEmpty in interface CollectionisEmpty in interface ListisEmpty in interface IObservableListisEmpty in class AbstractCollectionpublic boolean contains(Object o)
contains in interface Collectioncontains in interface Listcontains in interface IObservableListcontains in class AbstractCollectionpublic Iterator iterator()
iterator in interface Iterableiterator in interface Collectioniterator in interface Listiterator in interface IObservableListiterator in class AbstractListpublic Object[] toArray()
toArray in interface CollectiontoArray in interface ListtoArray in interface IObservableListtoArray in class AbstractCollectionpublic Object[] toArray(Object[] a)
toArray in interface CollectiontoArray in interface ListtoArray in interface IObservableListtoArray in class AbstractCollectionpublic boolean add(Object o)
add in interface Collectionadd in interface Listadd in interface IObservableListadd in class AbstractListpublic 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 boolean remove(Object o)
remove in interface Collectionremove in interface Listremove in interface IObservableListremove in class AbstractCollectionpublic boolean containsAll(Collection c)
containsAll in interface CollectioncontainsAll in interface ListcontainsAll in interface IObservableListcontainsAll in class AbstractCollectionpublic boolean addAll(Collection c)
addAll in interface CollectionaddAll in interface ListaddAll in interface IObservableListaddAll in class AbstractCollectionpublic boolean addAll(int index,
Collection c)
addAll in interface ListaddAll in interface IObservableListaddAll in class AbstractListpublic boolean removeAll(Collection c)
removeAll in interface CollectionremoveAll in interface ListremoveAll in interface IObservableListremoveAll in class AbstractCollectionpublic boolean retainAll(Collection c)
retainAll in interface CollectionretainAll in interface ListretainAll in interface IObservableListretainAll in class AbstractCollectionpublic boolean equals(Object o)
equals in interface Collectionequals in interface Listequals in interface IObservableListequals in class AbstractListpublic int hashCode()
hashCode in interface CollectionhashCode in interface ListhashCode in interface IObservableListhashCode in class AbstractListpublic int indexOf(Object o)
indexOf in interface ListindexOf in interface IObservableListindexOf in class AbstractListpublic int lastIndexOf(Object o)
lastIndexOf in interface ListlastIndexOf in interface IObservableListlastIndexOf in class AbstractListpublic Realm getRealm()
IObservableBecause observables can only be accessed from within one realm, and they always fire events on that realm, their state can be observed in an incremental way. It is always safe to call getters of an observable from within a change listener attached to that observable.
getRealm in interface IObservableprotected void checkRealm()
AssertionFailedException - if the realm is not the current realmRealm.isCurrent()
Copyright (c) 2000, 2014 Eclipse Contributors and others. All rights reserved.Guidelines for using Eclipse APIs.