T - the reactive-observer's typepublic class OriginalObservableWrapper<T> extends java.util.Observable implements CloseableObservable<T>
| Modifier and Type | Field and Description |
|---|---|
protected Action0E<? extends java.io.IOException> |
closeAction
The close action.
|
protected java.util.Observable |
observable
The observable.
|
| Constructor and Description |
|---|
OriginalObservableWrapper(java.util.Observable observable)
Wraps the given observable and sets a close
action to remove all observers.
|
OriginalObservableWrapper(java.util.Observable observable,
Action0 action)
Wraps the given observable which calls the supplied
action in case of a close event and unregisters all observables.
|
OriginalObservableWrapper(java.util.Observable observable,
Action0 closeAction,
boolean unregisterAll)
Wraps the given observable and sets up this observable
to call the closeAction on close() and remove all
registered observers if unregisterAll is true.
|
OriginalObservableWrapper(java.util.Observable observable,
Action0E<? extends java.io.IOException> action)
Wraps the given observable which calls the supplied
action in case of a close event and unregisters all observables.
|
OriginalObservableWrapper(java.util.Observable observable,
Action0E<? extends java.io.IOException> closeAction,
boolean unregisterAll)
Wraps the given observable and sets up this observable
to call the closeAction on close() and remove all
registered observers if unregisterAll is true.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addObserver(java.util.Observer o) |
void |
close() |
int |
countObservers() |
void |
deleteObserver(java.util.Observer o) |
void |
deleteObservers() |
boolean |
hasChanged() |
void |
notifyObservers() |
void |
notifyObservers(java.lang.Object arg) |
java.io.Closeable |
register(java.util.Observer observer)
Registers a java-observer and returns a handle to it.
|
java.io.Closeable |
register(Observer<? super T> observer)
Registers an observer for the notification of Ts.
|
@Nonnull protected final java.util.Observable observable
@Nonnull protected final Action0E<? extends java.io.IOException> closeAction
public OriginalObservableWrapper(@Nonnull
java.util.Observable observable)
observable - the java-observable to wrappublic OriginalObservableWrapper(@Nonnull
java.util.Observable observable,
@Nonnull
Action0 action)
observable - the java-observable to wrapaction - the close actionpublic OriginalObservableWrapper(@Nonnull
java.util.Observable observable,
@Nonnull
Action0 closeAction,
boolean unregisterAll)
observable - the java-observable to wrapcloseAction - the close actionunregisterAll - undegister all observers on close?public OriginalObservableWrapper(@Nonnull
java.util.Observable observable,
@Nonnull
Action0E<? extends java.io.IOException> action)
observable - the java-observable to wrapaction - the close actionpublic OriginalObservableWrapper(@Nonnull
java.util.Observable observable,
@Nonnull
Action0E<? extends java.io.IOException> closeAction,
boolean unregisterAll)
observable - the java-observable to wrapcloseAction - the close actionunregisterAll - undegister all observers on close?public void addObserver(java.util.Observer o)
addObserver in class java.util.Observablepublic void deleteObserver(java.util.Observer o)
deleteObserver in class java.util.Observablepublic void deleteObservers()
deleteObservers in class java.util.Observablepublic int countObservers()
countObservers in class java.util.Observablepublic void notifyObservers()
notifyObservers in class java.util.Observablepublic void notifyObservers(java.lang.Object arg)
notifyObservers in class java.util.Observablepublic boolean hasChanged()
hasChanged in class java.util.Observable@Nonnull
public java.io.Closeable register(@Nonnull
java.util.Observer observer)
The convenience method is to have symmetric means for both observer kinds to interact with this observable.
observer - the observer to registerpublic void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOException@Nonnull
public java.io.Closeable register(@Nonnull
Observer<? super T> observer)
Observableregister in interface Observable<T>observer - the observer of Ts or any supertype of it