|
Eclipse Platform Release 3.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList
org.eclipse.core.databinding.observable.list.AbstractObservableList
public abstract class AbstractObservableList
Subclasses should override at least get(int index) and size().
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.
| Field Summary |
|---|
| Fields inherited from class java.util.AbstractList |
|---|
modCount |
| Constructor Summary | |
|---|---|
AbstractObservableList()
|
|
AbstractObservableList(Realm realm)
|
|
| Method Summary | |
|---|---|
boolean |
add(java.lang.Object o)
|
boolean |
addAll(java.util.Collection c)
|
boolean |
addAll(int index,
java.util.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(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. |
protected abstract int |
doGetSize()
|
boolean |
equals(java.lang.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(java.lang.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. |
java.util.Iterator |
iterator()
|
int |
lastIndexOf(java.lang.Object o)
|
protected void |
lastListenerRemoved()
|
java.lang.Object |
move(int oldIndex,
int newIndex)
Moves the element located at oldIndex to
newIndex. |
boolean |
remove(java.lang.Object o)
|
boolean |
removeAll(java.util.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(java.util.Collection c)
|
int |
size()
|
java.lang.Object[] |
toArray()
|
java.lang.Object[] |
toArray(java.lang.Object[] a)
|
| Methods inherited from class java.util.AbstractList |
|---|
add, clear, get, listIterator, listIterator, remove, removeRange, set, subList |
| Methods inherited from class java.util.AbstractCollection |
|---|
toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.eclipse.core.databinding.observable.list.IObservableList |
|---|
get, getElementType, listIterator, listIterator, remove, set, subList |
| Methods inherited from interface java.util.List |
|---|
add, clear |
| Constructor Detail |
|---|
public AbstractObservableList(Realm realm)
realm - public AbstractObservableList()
| Method Detail |
|---|
protected boolean hasListeners()
public boolean isStale()
IObservable
isStale in interface IObservablepublic void addListChangeListener(IListChangeListener listener)
IObservableList
addListChangeListener in interface IObservableListpublic void removeListChangeListener(IListChangeListener listener)
IObservableList
removeListChangeListener in interface IObservableListprotected void fireListChange(ListDiff diff)
public void addChangeListener(IChangeListener listener)
IObservable
addChangeListener in interface IObservablepublic void removeChangeListener(IChangeListener listener)
IObservable
removeChangeListener in interface IObservablepublic void addStaleListener(IStaleListener listener)
IObservable
addStaleListener in interface IObservableIObservable.isStale()public void removeStaleListener(IStaleListener listener)
IObservable
removeStaleListener in interface IObservablepublic void addDisposeListener(IDisposeListener listener)
IObservable
addDisposeListener in interface IObservablelistener - the listener to addpublic void removeDisposeListener(IDisposeListener listener)
IObservable
removeDisposeListener in interface IObservablelistener - the listener to removeprotected void fireChange()
protected void fireStale()
protected void firstListenerAdded()
protected void lastListenerRemoved()
public boolean isDisposed()
IObservable
isDisposed in interface IObservablepublic void dispose()
IObservable
dispose in interface IObservablepublic final int size()
size in interface java.util.Collectionsize in interface java.util.Listsize in interface IObservableListsize in class java.util.AbstractCollectionprotected abstract int doGetSize()
public boolean isEmpty()
isEmpty in interface java.util.CollectionisEmpty in interface java.util.ListisEmpty in interface IObservableListisEmpty in class java.util.AbstractCollectionpublic boolean contains(java.lang.Object o)
contains in interface java.util.Collectioncontains in interface java.util.Listcontains in interface IObservableListcontains in class java.util.AbstractCollectionpublic java.util.Iterator iterator()
iterator in interface java.lang.Iterableiterator in interface java.util.Collectioniterator in interface java.util.Listiterator in interface IObservableListiterator in class java.util.AbstractListpublic java.lang.Object[] toArray()
toArray in interface java.util.CollectiontoArray in interface java.util.ListtoArray in interface IObservableListtoArray in class java.util.AbstractCollectionpublic java.lang.Object[] toArray(java.lang.Object[] a)
toArray in interface java.util.CollectiontoArray in interface java.util.ListtoArray in interface IObservableListtoArray in class java.util.AbstractCollectionpublic boolean add(java.lang.Object o)
add in interface java.util.Collectionadd in interface java.util.Listadd in interface IObservableListadd in class java.util.AbstractList
public java.lang.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().
java.lang.IndexOutOfBoundsException - if either argument is out of range (0 <= index < size()).ListDiffVisitor.handleMove(int, int, Object),
ListDiff.accept(ListDiffVisitor)public boolean remove(java.lang.Object o)
remove in interface java.util.Collectionremove in interface java.util.Listremove in interface IObservableListremove in class java.util.AbstractCollectionpublic boolean containsAll(java.util.Collection c)
containsAll in interface java.util.CollectioncontainsAll in interface java.util.ListcontainsAll in interface IObservableListcontainsAll in class java.util.AbstractCollectionpublic boolean addAll(java.util.Collection c)
addAll in interface java.util.CollectionaddAll in interface java.util.ListaddAll in interface IObservableListaddAll in class java.util.AbstractCollection
public boolean addAll(int index,
java.util.Collection c)
addAll in interface java.util.ListaddAll in interface IObservableListaddAll in class java.util.AbstractListpublic boolean removeAll(java.util.Collection c)
removeAll in interface java.util.CollectionremoveAll in interface java.util.ListremoveAll in interface IObservableListremoveAll in class java.util.AbstractCollectionpublic boolean retainAll(java.util.Collection c)
retainAll in interface java.util.CollectionretainAll in interface java.util.ListretainAll in interface IObservableListretainAll in class java.util.AbstractCollectionpublic boolean equals(java.lang.Object o)
equals in interface java.util.Collectionequals in interface java.util.Listequals in interface IObservableListequals in class java.util.AbstractListpublic int hashCode()
hashCode in interface java.util.CollectionhashCode in interface java.util.ListhashCode in interface IObservableListhashCode in class java.util.AbstractListpublic int indexOf(java.lang.Object o)
indexOf in interface java.util.ListindexOf in interface IObservableListindexOf in class java.util.AbstractListpublic int lastIndexOf(java.lang.Object o)
lastIndexOf in interface java.util.ListlastIndexOf in interface IObservableListlastIndexOf in class java.util.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()
|
Eclipse Platform Release 3.6 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2010. All rights reserved.