|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectch.elca.el4j.util.observer.impl.AbstractObservableValue<T>
T - see supertype.public abstract class AbstractObservableValue<T>
Abstract ObservableValue featuring value and observer storage as well as notification.
| Constructor Summary | |
|---|---|
protected |
AbstractObservableValue()
creates a new ObservableValue. |
|
AbstractObservableValue(T initialReference)
creates a new ObservableValue. |
| Method Summary | |
|---|---|
protected boolean |
equal(T a,
T b)
defines when two references are considered equal. |
T |
get()
|
protected void |
set(T newValue)
updates this observer's current value and announces the change. |
void |
subscribe(ValueObserver<? super T> o)
subscribe to this observable's change notifications. |
void |
subscribeSilently(ValueObserver<? super T> o)
subscribe to this observable's change notifications without getting an initial change notification. |
void |
unsubscribe(ValueObserver<? super T> o)
unsubscribes from this observable's change notifications, i.e. no change notification will be sent anymore. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected AbstractObservableValue()
set(Object) to
set the initial reference before get() is invoked.
public AbstractObservableValue(T initialReference)
initialReference - the observable's initial value| Method Detail |
|---|
public void subscribeSilently(ValueObserver<? super T> o)
subscribeSilently in interface ObservableValue<T>o - the object to receive change notificationspublic void subscribe(ValueObserver<? super T> o)
subscribe in interface ObservableValue<T>o - the object to receive change notificationspublic void unsubscribe(ValueObserver<? super T> o)
unsubscribe in interface ObservableValue<T>o - the object no longer to receive change notificationsprotected void set(T newValue)
public T get()
throws IllegalStateException
get in interface ObservableValue<T>IllegalStateException - if the observed reference does not
exist yet.
protected boolean equal(T a,
T b)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||