Package org.reactfx
Class ObservableStateBuilderImpl<S>
- java.lang.Object
-
- org.reactfx.ObservableStateBuilderImpl<S>
-
- All Implemented Interfaces:
StateMachine.ObservableStateBuilder<S>
class ObservableStateBuilderImpl<S> extends java.lang.Object implements StateMachine.ObservableStateBuilder<S>
-
-
Field Summary
Fields Modifier and Type Field Description private S
initialState
private LL<TransitionBuilder<S>>
transitions
-
Constructor Summary
Constructors Constructor Description ObservableStateBuilderImpl(S initialState, LL<TransitionBuilder<S>> transitions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <I> StateMachine.ObservableStateBuilderOn<S,I>
on(EventStream<I> input)
javafx.beans.binding.Binding<S>
toObservableState()
Returns a binding that reflects the current state of the state machine.EventStream<S>
toStateStream()
Returns an event stream that emits the current state of the state machine every time it changes.
-
-
-
Field Detail
-
initialState
private final S initialState
-
transitions
private final LL<TransitionBuilder<S>> transitions
-
-
Constructor Detail
-
ObservableStateBuilderImpl
ObservableStateBuilderImpl(S initialState, LL<TransitionBuilder<S>> transitions)
-
-
Method Detail
-
on
public <I> StateMachine.ObservableStateBuilderOn<S,I> on(EventStream<I> input)
- Specified by:
on
in interfaceStateMachine.ObservableStateBuilder<S>
-
toStateStream
public EventStream<S> toStateStream()
Description copied from interface:StateMachine.ObservableStateBuilder
Returns an event stream that emits the current state of the state machine every time it changes.- Specified by:
toStateStream
in interfaceStateMachine.ObservableStateBuilder<S>
-
toObservableState
public javafx.beans.binding.Binding<S> toObservableState()
Description copied from interface:StateMachine.ObservableStateBuilder
Returns a binding that reflects the current state of the state machine. Disposing the returned binding (by calling itsdispose()
method) causes the state machine to unsubscribe from the event streams that alter its state and allows the state machine to be garbage collected.- Specified by:
toObservableState
in interfaceStateMachine.ObservableStateBuilder<S>
-
-