|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcore.State
public class State
This class represents a single state of a FSM, the components being its name and its transitions.
Method Summary | |
---|---|
void |
addTransition(java.lang.String symbol,
State... s)
Adds a transition to the State, the symbol is automatically added to the state's finite state machine |
void |
addTransition(java.lang.String symbol,
java.lang.String... s)
|
int |
compareTo(java.lang.Object o)
|
boolean |
equals(java.lang.Object obj)
|
java.lang.String |
getName()
|
java.lang.String |
getStringDescription()
|
java.util.Map<java.lang.String,java.util.ArrayList<State>> |
getTransitions()
|
boolean |
isFinal()
|
boolean |
isInitial()
|
boolean |
removeTransition(java.lang.String symbol)
|
boolean |
removeTransition(java.lang.String symbol,
State s)
|
boolean |
removeTransitions(State toRemove)
Removes all transitions to the given state |
void |
setFinal(boolean finalState)
|
void |
setInitial(boolean initialState)
|
java.lang.String |
toString()
|
java.util.ArrayList<State> |
transition(java.lang.String symbol)
Returns the successors of the state with the given symbol, null if none exist. |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public void addTransition(java.lang.String symbol, State... s)
symbol
- The symbol with which the state should transitions
- The successor states reachable through transitioning with
symbolpublic void addTransition(java.lang.String symbol, java.lang.String... s)
public java.util.Map<java.lang.String,java.util.ArrayList<State>> getTransitions()
public int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String getName()
public boolean isFinal()
public boolean isInitial()
public boolean removeTransition(java.lang.String symbol)
public boolean removeTransition(java.lang.String symbol, State s)
public boolean removeTransitions(State toRemove)
toRemove
- The state to which all transitions are to be removed
public void setFinal(boolean finalState)
public void setInitial(boolean initialState)
public java.lang.String getStringDescription()
public java.lang.String toString()
toString
in class java.lang.Object
public java.util.ArrayList<State> transition(java.lang.String symbol)
symbol
- The symbol to transition with.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |