public abstract class AbstractValue<T> extends Reactor implements ValueView<T>
Reactor.RListener
ValueView.Listener<T>
Constructor and Description |
---|
AbstractValue() |
Modifier and Type | Method and Description |
---|---|
SignalView<T> |
changes()
Returns a signal that is emitted whenever this value changes.
|
Connection |
connect(SignalView.Listener<? super T> listener)
Connects the supplied listener to this value, such that it will be notified when this value
changes.
|
Connection |
connect(Slot<? super T> slot)
Connects the supplied listener to this value, such that it will be notified when this value
changes.
|
Connection |
connect(ValueView.Listener<? super T> listener)
Connects the supplied listener to this value, such that it will be notified when this value
changes.
|
Connection |
connectNotify(SignalView.Listener<? super T> listener)
Connects the supplied listener to this value, such that it will be notified when this value
changes.
|
Connection |
connectNotify(Slot<? super T> slot)
Connects the supplied listener to this value, such that it will be notified when this value
changes.
|
Connection |
connectNotify(ValueView.Listener<? super T> listener)
Connects the supplied listener to this value, such that it will be notified when this value
changes.
|
void |
disconnect(ValueView.Listener<? super T> listener)
Disconnects the supplied listener from this value if it's connected.
|
boolean |
equals(Object other) |
<M> ValueView<M> |
flatMap(Function<? super T,? extends ValueView<M>> func)
Creates a value that flat maps (monadic binds) this value via a function.
|
int |
hashCode() |
<M> ValueView<M> |
map(Function<? super T,M> func)
Creates a value that maps this value via a function.
|
String |
toString() |
RFuture<T> |
when(Function<? super T,Boolean> cond)
Returns a future which is completed with this value when the value meeds
cond . |
clearConnections, hasConnections
public <M> ValueView<M> map(Function<? super T,M> func)
ValueView
public <M> ValueView<M> flatMap(Function<? super T,? extends ValueView<M>> func)
ValueView
public SignalView<T> changes()
ValueView
public RFuture<T> when(Function<? super T,Boolean> cond)
ValueView
cond
. If
the value meets cond
now, the future will be completed immediately, otherwise the
future will be completed when the value changes to a value which meets cond
.public Connection connect(ValueView.Listener<? super T> listener)
ValueView
public Connection connectNotify(ValueView.Listener<? super T> listener)
ValueView
connectNotify
in interface ValueView<T>
public Connection connect(SignalView.Listener<? super T> listener)
ValueView
public Connection connectNotify(SignalView.Listener<? super T> listener)
ValueView
connectNotify
in interface ValueView<T>
public Connection connect(Slot<? super T> slot)
ValueView
public Connection connectNotify(Slot<? super T> slot)
ValueView
connectNotify
in interface ValueView<T>
public void disconnect(ValueView.Listener<? super T> listener)
ValueView
disconnect
in interface ValueView<T>
Copyright © 2017. All rights reserved.