public class State extends Object implements Serializable, Comparable<State>
| Constructor and Description |
|---|
State()
Constructs a new state.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addTransition(Transition t)
Adds an outgoing transition.
|
int |
compareTo(State s)
Compares this object with the specified object for order.
|
boolean |
equals(Object obj)
|
List<Transition> |
getSortedTransitions(boolean to_first)
Returns sorted list of outgoing transitions.
|
Set<Transition> |
getTransitions()
Returns the set of outgoing transitions.
|
int |
hashCode()
See
Object.hashCode(). |
boolean |
isAccept()
Returns acceptance status.
|
void |
setAccept(boolean accept)
Sets acceptance for this state.
|
State |
step(char c)
Performs lookup in transitions, assuming determinism.
|
void |
step(char c,
Collection<State> dest)
Performs lookup in transitions, allowing nondeterminism.
|
String |
toString()
Returns string describing this state.
|
public State()
public void addTransition(Transition t)
t - transitionpublic int compareTo(State s)
compareTo in interface Comparable<State>public List<Transition> getSortedTransitions(boolean to_first)
to_first - if true, order by (to, min, reverse max); otherwise (min, reverse max, to)public Set<Transition> getTransitions()
public int hashCode()
Object.hashCode().public boolean isAccept()
public void setAccept(boolean accept)
accept - if true, this state is an accept statepublic State step(char c)
c - character to look upstep(char, Collection)public void step(char c,
Collection<State> dest)
c - character to look updest - collection where destination states are storedstep(char)public String toString()
Automaton.toString().Copyright © 2001-2017 Anders Møller.