public class State extends java.lang.Object implements java.io.Serializable, java.lang.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(java.lang.Object obj)
See
Object.equals(java.lang.Object) . |
java.util.List<Transition> |
getSortedTransitions(boolean to_first)
Returns sorted list of outgoing transitions.
|
java.util.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,
java.util.Collection<State> dest)
Performs lookup in transitions, allowing nondeterminism.
|
java.lang.String |
toString()
Returns string describing this state.
|
public State()
public void addTransition(Transition t)
t
- transitionpublic int compareTo(State s)
compareTo
in interface java.lang.Comparable<State>
public boolean equals(java.lang.Object obj)
Object.equals(java.lang.Object)
.equals
in class java.lang.Object
public java.util.List<Transition> getSortedTransitions(boolean to_first)
to_first
- if true, order by (to, min, reverse max); otherwise (min, reverse max, to)public java.util.Set<Transition> getTransitions()
public int hashCode()
Object.hashCode()
.hashCode
in class java.lang.Object
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, java.util.Collection<State> dest)
c
- character to look updest
- collection where destination states are storedstep(char)
public java.lang.String toString()
Automaton.toString()
.toString
in class java.lang.Object
Copyright © 2001-2011 Anders Møller.