public class State
extends java.lang.Object
Constructor and Description |
---|
State()
Constructs the empty state.
|
State(java.lang.String str)
Constructs a state with the initial values.
|
State(java.lang.String[] str,
java.lang.String[] vals)
Constructs a state with the initial values.
|
Modifier and Type | Method and Description |
---|---|
int |
getStatesNum()
Returns the number of all variables in the state.
|
java.lang.String |
getValue(java.lang.String var)
Returns the value of the variable in the state.
|
java.lang.String[] |
getVars()
Returns the list of all variable in the state.
|
boolean |
isEqual(State st)
Checks whether the two state are equivalent,
|
void |
printState()
Print the state.
|
void |
printState2()
Print the state.
|
void |
removeValue(java.lang.String var)
Remove the variable from the state.
|
java.lang.String |
strAll(java.lang.String var)
Returns the whole state as string.
|
java.lang.String |
stringState()
Returns the string of the state.
|
java.lang.String |
stringValue(java.lang.String var)
Returns the name of the variable.
|
void |
updateValue(java.lang.String var,
java.lang.String val)
Updates the value of the variable in the state.
|
public State()
public State(java.lang.String str)
str
- label (e.g. variable)public State(java.lang.String[] str, java.lang.String[] vals)
str
- label (e.g. variable)vals
- valuepublic int getStatesNum()
public java.lang.String getValue(java.lang.String var)
var
- variablepublic java.lang.String[] getVars()
public boolean isEqual(State st)
st
- statepublic void printState()
public void printState2()
public void removeValue(java.lang.String var)
var
- variablepublic java.lang.String strAll(java.lang.String var)
var
- variablepublic java.lang.String stringState()
public java.lang.String stringValue(java.lang.String var)
var
- variablepublic void updateValue(java.lang.String var, java.lang.String val)
var
- variableval
- the value of the variable