public class FSA
extends java.lang.Object
implements java.io.Serializable
Constructor and Description |
---|
FSA()
Create the FSA by taking in input all the parameters and store the created Automaton.
|
FSA(java.lang.String message)
Create a FSA by taking in input the parameters
|
FSA(Transition[] t)
initialize only the transitions
|
Modifier and Type | Method and Description |
---|---|
protected Simulator |
createSim() |
protected Transition |
createTransition(int i) |
int[] |
getFinalStates() |
int |
getInitial() |
int |
getStates() |
Transition[] |
getTransition() |
static FSA |
load(java.lang.String name)
Load a stored automaton
|
void |
print()
Print in output a description of the automaton
|
void |
run()
Take in input a string to be recognized by the automaton, create an instance of the Simulator
and run it with the string in input.
|
void |
setTransition(Transition[] tra) |
static void |
write(FSA a)
Store in a file the automaton
|
public FSA(java.lang.String message)
message
- a message of helppublic FSA()
public FSA(Transition[] t)
t
- public void print()
public static void write(FSA a)
a
- the automaton to be savedpublic static FSA load(java.lang.String name)
name
- the name of the filepublic void run()
public int getInitial()
public int[] getFinalStates()
public Transition[] getTransition()
public void setTransition(Transition[] tra)
tra
- initialize the variable Transitionpublic int getStates()
protected Simulator createSim()
protected Transition createTransition(int i)
i
- the index of the transition to be showed as a message to the user