public interface SignalView<T>
Signal
, on which slots may listen, but to which one cannot emit events. This
is generally used to provide signal-like views of changing entities. See AbstractValue
for an example.Modifier and Type | Interface and Description |
---|---|
static interface |
SignalView.Listener<T>
Used to observe events from a signal.
|
Modifier and Type | Method and Description |
---|---|
<M> SignalView<M> |
collect(Function<? super T,M> collector)
Creates a signal that maps the values emitted by this signal through
collector and
emits only the non-null values that are returned. |
Connection |
connect(SignalView.Listener<? super T> slot)
Connects this signal to the supplied slot, such that when an event is emitted from this
signal, the slot will be notified.
|
void |
disconnect(SignalView.Listener<? super T> slot)
Disconnects the supplied slot from this signal if connect was called with it.
|
SignalView<T> |
filter(Function<? super T,Boolean> pred)
Creates a signal that emits a value only when the supplied filter function returns true.
|
<M> SignalView<M> |
map(Function<? super T,M> func)
Creates a signal that maps this signal via a function.
|
RFuture<T> |
next()
Returns a future that is completed with the next value from this signal.
|
<M> SignalView<M> map(Function<? super T,M> func)
SignalView<T> filter(Function<? super T,Boolean> pred)
<M> SignalView<M> collect(Function<? super T,M> collector)
collector
and
emits only the non-null values that are returned. This allows you to perform a type-test on
the values emitted by a signal and only emit values of the appropriate subtype.Connection connect(SignalView.Listener<? super T> slot)
void disconnect(SignalView.Listener<? super T> slot)
Copyright © 2017. All rights reserved.