|
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.AbstractMap
org.eclipse.core.databinding.observable.map.AbstractObservableMap
public abstract class AbstractObservableMap
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.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface java.util.Map |
|---|
java.util.Map.Entry<K,V> |
| Constructor Summary | |
|---|---|
AbstractObservableMap()
|
|
AbstractObservableMap(Realm realm)
|
|
| Method Summary | |
|---|---|
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 |
addMapChangeListener(IMapChangeListener listener)
|
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. |
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 void |
fireChange()
Fires change events. |
protected void |
fireMapChange(MapDiff diff)
Fires map change events. |
protected void |
fireStale()
Fires stale events. |
protected void |
firstListenerAdded()
|
java.lang.Object |
getKeyType()
Returns the element type for the keyset of this
observable map, or null if the keyset is untyped. |
Realm |
getRealm()
Returns the realm for this observable. |
java.lang.Object |
getValueType()
Returns the element type for the values of this
observable map, or null if the values collection is untyped. |
protected boolean |
hasListeners()
|
boolean |
isDisposed()
Returns whether the observable has been disposed |
boolean |
isStale()
Returns whether the state of this observable is stale and is expected to change soon. |
protected void |
lastListenerRemoved()
|
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 |
removeMapChangeListener(IMapChangeListener listener)
|
void |
removeStaleListener(IStaleListener listener)
Removes the given stale listener from the list of stale listeners. |
void |
setStale(boolean stale)
Sets the stale state. |
| Methods inherited from class java.util.AbstractMap |
|---|
clear, clone, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, toString, values |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.eclipse.core.databinding.observable.map.IObservableMap |
|---|
containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, remove, size, values |
| Methods inherited from interface java.util.Map |
|---|
clear, putAll |
| Constructor Detail |
|---|
public AbstractObservableMap()
public AbstractObservableMap(Realm realm)
realm - | Method Detail |
|---|
protected void lastListenerRemoved()
protected void firstListenerAdded()
public void addMapChangeListener(IMapChangeListener listener)
addMapChangeListener in interface IObservableMappublic void removeMapChangeListener(IMapChangeListener listener)
removeMapChangeListener in interface IObservableMappublic void addChangeListener(IChangeListener listener)
IObservable
addChangeListener in interface IObservablepublic void addStaleListener(IStaleListener listener)
IObservable
addStaleListener in interface IObservableIObservable.isStale()protected boolean hasListeners()
public 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 removepublic boolean isDisposed()
IObservable
isDisposed in interface IObservablepublic void dispose()
IObservable
dispose in interface IObservablepublic 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 IObservablepublic boolean isStale()
IObservable
isStale in interface IObservablepublic java.lang.Object getKeyType()
IObservableMapkeyset of this
observable map, or null if the keyset is untyped.
getKeyType in interface IObservableMapkeyset of this
observable map, or null if the keyset is untyped.public java.lang.Object getValueType()
IObservableMapvalues of this
observable map, or null if the values collection is untyped.
getValueType in interface IObservableMapvalues of this
observable map, or null if the values collection is
untyped.public void removeChangeListener(IChangeListener listener)
IObservable
removeChangeListener in interface IObservablepublic void removeStaleListener(IStaleListener listener)
IObservable
removeStaleListener in interface IObservablepublic void setStale(boolean stale)
stale - protected void fireStale()
protected void fireChange()
protected void fireMapChange(MapDiff diff)
diff - protected 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.