
de.scravy.machina.StateMachineWithState Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of machina Show documentation
Show all versions of machina Show documentation
A finite state machine library that features true stateless
state machines.
package de.scravy.machina;
class StateMachineWithState
extends
AbstractDelegatingStateMachine>
implements SimpleStatefulStateMachine
{
private S state;
StateMachineWithState(
final SimpleStateMachine fsm, final S initialState) {
super(fsm);
this.state = initialState;
}
StateMachineWithState(
final SimpleStateMachine fsm) {
this(fsm, fsm.getInitialState());
}
@Override
public S getState() {
return this.state;
}
@Override
public void fire(final E event) {
this.state = this.fsm.run(this.state, event);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy