public abstract class AbstractMathStateMachine extends org.vesalainen.util.AbstractStateMachine<BooleanMathExpression,org.vesalainen.util.AbstractStateMachine.State>
Implementing class defines variables except $startTime, $elapsedTime, $stateStartTime and $stateElapsedTime which are defined by this class.
MathExpressionParser,
AbstractStateMachine.getStartTime(),
AbstractStateMachine.getElapsedTime(),
AbstractStateMachine.getStateStartTime(),
AbstractStateMachine.getStateElapsedTime()| Modifier and Type | Field and Description |
|---|---|
static String |
ELAPSED_TIME |
static String |
START_TIME |
static String |
STATE_ELAPSED_TIME |
static String |
STATE_START_TIME |
| Constructor and Description |
|---|
AbstractMathStateMachine(String start) |
AbstractMathStateMachine(String start,
boolean useDegrees) |
AbstractMathStateMachine(String start,
java.util.function.Supplier<java.time.Clock> clockSupplier,
boolean useDegrees) |
| Modifier and Type | Method and Description |
|---|---|
void |
addTransition(String from,
String condition,
String to) |
void |
evaluate() |
Set<String> |
getCurrentVariables()
Returns a set of variables used in current state.
|
protected abstract double |
getVariable(String identifier)
Returns the current value of given variable.
|
protected abstract void |
register(Set<String> variables)
This method is called before evaluation for information of variables
that may need to be registered.
|
protected abstract void |
unregister(Set<String> variables)
This method is called after evaluation for information of variables
that can be unregistered.
|
public static final String START_TIME
public static final String ELAPSED_TIME
public static final String STATE_START_TIME
public static final String STATE_ELAPSED_TIME
public AbstractMathStateMachine(String start)
public AbstractMathStateMachine(String start, boolean useDegrees)
public AbstractMathStateMachine(String start, java.util.function.Supplier<java.time.Clock> clockSupplier, boolean useDegrees)
public Set<String> getCurrentVariables() throws Exception
Exceptionprotected abstract double getVariable(String identifier) throws IOException
identifier - IOExceptionpublic void evaluate()
throws Exception
evaluate in class org.vesalainen.util.AbstractStateMachine<BooleanMathExpression,org.vesalainen.util.AbstractStateMachine.State>Exceptionprotected abstract void register(Set<String> variables)
variables - Copyright © 2017. All rights reserved.