Package at.jku.ssw.fp.sect05_4.dsl
Class StateModel.State
- java.lang.Object
-
- at.jku.ssw.fp.sect05_4.dsl.StateModel.State
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
StateModel.State.Transition
Inner class representing transitions.
-
Field Summary
Fields Modifier and Type Field Description (package private) List<StateModel.State.Transition>
transitions
List of transition objects for this state
-
Constructor Summary
Constructors Modifier Constructor Description protected
State()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
exec()
Executes the state object by looking for a executable transition and executing the action of the first transition with a condition being fulfilled.StateModel.State
on(BooleanSupplier cond, Action action)
Adds a transition which triggers based on the given condition.
-
-
-
Field Detail
-
transitions
final List<StateModel.State.Transition> transitions
List of transition objects for this state
-
-
Method Detail
-
exec
public void exec()
Executes the state object by looking for a executable transition and executing the action of the first transition with a condition being fulfilled.
-
on
public StateModel.State on(BooleanSupplier cond, Action action)
Adds a transition which triggers based on the given condition.- Parameters:
cond
- the transition conditionaction
- the transition action- Returns:
- this state object
-
-