All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.scravy.machina.StateMachineWithState Maven / Gradle / Ivy

Go to download

A finite state machine library that features true stateless state machines.

There is a newer version: 1.3.1
Show newest version
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