|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdatastructure.FiniteStateMachine
public class FiniteStateMachine
This class represents a finite state machine FSM = , S, I, ?, F> where
Constructor Summary | |
---|---|
FiniteStateMachine()
|
Method Summary | |
---|---|
boolean |
accepts(java.lang.String... s)
Checks whether the FSM accepts the given input. |
java.lang.Object |
clone()
Makes a deep copy of the FSM |
FiniteStateMachine |
complement()
|
State |
createState(java.lang.String name,
StateType type)
Creates a new State of the specified type in the fsm. |
java.util.ArrayList<State> |
getFinalStates()
|
java.util.ArrayList<State> |
getInitialStates()
|
java.util.ArrayList<State> |
getStates()
|
FiniteStateMachine |
product(FiniteStateMachine fsm)
|
boolean |
removeState(State s)
Removes a state (also initial state and final state) from the FSM. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public FiniteStateMachine()
Method Detail |
---|
public State createState(java.lang.String name, StateType type)
name
- The name of the state to add, read BEWARE-information abovetype
- An enumeration giving the type of the State, either NORMAL_STATE,INITIAL_STATE,FINAL_STATE or INITIAL_FINAL_STATE
public boolean removeState(State s)
s
- The state to be removed. May not be null.
public java.util.ArrayList<State> getStates()
public java.util.ArrayList<State> getInitialStates()
public java.util.ArrayList<State> getFinalStates()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean accepts(java.lang.String... s)
s
- the input
public FiniteStateMachine product(FiniteStateMachine fsm)
public FiniteStateMachine complement()
public java.lang.Object clone()
clone
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |