Constructor and Description |
---|
Automaton.Builder()
Sole constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addTransition(int source,
int dest,
int label)
Add a new transition with min = max = label.
|
void |
addTransition(int source,
int dest,
int min,
int max)
Add a new transition with the specified source, dest, min, max.
|
void |
copy(Automaton other)
Copies over all states/transitions from other.
|
int |
createState()
Create a new state.
|
Automaton |
finish()
Compiles all added states and transitions into a new
Automaton
and returns it. |
int |
getNumStates()
How many states this automaton has.
|
boolean |
isAccept(int state)
Returns true if this state is an accept state.
|
void |
setAccept(int state,
boolean accept)
Set or clear this state as an accept state.
|
public void addTransition(int source, int dest, int label)
public void addTransition(int source, int dest, int min, int max)
public Automaton finish()
Automaton
and returns it.public int createState()
public void setAccept(int state, boolean accept)
public boolean isAccept(int state)
public int getNumStates()
public void copy(Automaton other)
Copyright © 2000-2014 Apache Software Foundation. All Rights Reserved.