|
abc4j API Specification | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectscanner.State
public class State
This class defines states used in finale state automata.
| Constructor Summary | |
|---|---|
State(TokenType type,
boolean isTokenStateValue)
Constructs a new state. |
|
| Method Summary | |
|---|---|
void |
addTransition(Transition transition)
Adds a transition to this state. |
java.lang.Object |
clone()
|
int |
countTransitions()
Returns the number of transitions from this state. |
Transition |
getTransitionFor(char character)
Returns the transition that can be activated for the specified character. |
Transition[] |
getTransitions()
Returns an array containing transitions from this state. |
TokenType |
getType()
Returns the type of this state. |
boolean |
hasSelfTransitions()
Returns true if this state has self transitions. |
boolean |
isTokenState()
Returns true if this state is a token state. |
boolean |
removeTransition(Transition transition)
Removes the given transition. |
void |
setTokenState(boolean isToken)
Sets if this state is a token state or not. |
void |
setType(TokenType type)
Sets the type of this state. |
java.lang.String |
toString()
|
State |
union(State state)
Performs an union between this state and the given one. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public State(TokenType type,
boolean isTokenStateValue)
type - The type of the state.isTokenStateValue - true if the state is a token state,
falsew otherwise.| Method Detail |
|---|
public TokenType getType()
public Transition[] getTransitions()
public Transition getTransitionFor(char character)
character - A character.
public boolean hasSelfTransitions()
public int countTransitions()
public void setType(TokenType type)
type - The new type of this state.public void setTokenState(boolean isToken)
isToken - true if this state is a token state,
false otherwise.public boolean isTokenState()
public void addTransition(Transition transition)
transition - The transition to be added to this state.removeTransition(scanner.Transition)public boolean removeTransition(Transition transition)
transition - The transition to be removed.
addTransition(scanner.Transition)public State union(State state)
state - a State
public java.lang.Object clone()
clone in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
abc4j API Specification | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||