O - type of the observerT - type of produced valuespublic abstract class ObservableBase<O,T> extends java.lang.Object implements ProperObservable<O,T>
| Modifier | Constructor and Description |
|---|---|
protected |
ObservableBase() |
protected |
ObservableBase(NotificationAccumulator<O,T,?> pendingNotificationsImpl) |
| Modifier and Type | Method and Description |
|---|---|
void |
addObserver(O observer) |
protected void |
enqueueNotifications(T event) |
boolean |
equals(java.lang.Object o) |
protected void |
forEachObserver(java.util.function.Consumer<O> action)
Executes action for each observer, regardless of recursion state.
|
protected int |
getObserverCount() |
int |
hashCode() |
boolean |
isObservingInputs() |
protected void |
newObserver(O observer)
Called for each new observer.
|
protected void |
notifyObservers() |
void |
notifyObservers(T event) |
Subscription |
observe(O observer) |
protected abstract Subscription |
observeInputs()
Starts observing this observable's input(s), if any.
|
void |
removeObserver(O observer) |
java.lang.String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitdefaultEquals, defaultHashCode, defaultNotificationAccumulator, defaultToStringprotected ObservableBase(NotificationAccumulator<O,T,?> pendingNotificationsImpl)
protected ObservableBase()
protected abstract Subscription observeInputs()
newObserver(Object)
is called for the first observer.public final boolean isObservingInputs()
protected final int getObserverCount()
public final void notifyObservers(T event)
notifyObservers in interface ProperObservable<O,T>protected final void enqueueNotifications(T event)
protected final void notifyObservers()
protected final void forEachObserver(java.util.function.Consumer<O> action)
action throws an exception for one observer, it will not
be called for any subsequent observers and the exception will be
propagated by this method.action - action to execute for each observer.protected void newObserver(O observer)
This method is called after the
observeInputs() method.
public final Subscription observe(O observer)
observe in interface Observable<O>public final void addObserver(O observer)
addObserver in interface Observable<O>public final void removeObserver(O observer)
removeObserver in interface Observable<O>public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object