morfologik.fsa.characters
Class State

java.lang.Object
  extended by morfologik.fsa.characters.State
All Implemented Interfaces:
Traversable<State>

public final class State
extends Object
implements Traversable<State>

DFSA state with char labels on transitions.


Constructor Summary
State()
           
 
Method Summary
 boolean equals(Object obj)
          Two states are equal if: they have an identical number of outgoing transitions, labeled with the same labels corresponding outgoing transitions lead to the same states (to states with an identical right-language).
 State getState(char label)
          Returns the target state of a transition leaving this state and labeled with label.
 State[] getStates()
          Returns an array of outgoing transitions from this state.
 char[] getTransitionLabels()
          Returns an array of outgoing transition labels.
 boolean hasChildren()
          Return true if this state has any children (outgoing transitions).
 int hashCode()
          Compute the hash code of the current status of this state.
 boolean isFinal()
          Is this state a final state in the automaton?
 void postOrder(Visitor<? super State> v)
          Visit all sub-states in post-order.
 void preOrder(Visitor<? super State> v)
          Visit all sub-states in pre-order.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

State

public State()
Method Detail

getState

public State getState(char label)
Returns the target state of a transition leaving this state and labeled with label. If no such transition exists, returns null.


getTransitionLabels

public char[] getTransitionLabels()
Returns an array of outgoing transition labels. The array is sorted in lexicographic order and indexes correspond to states returned from getStates().


getStates

public State[] getStates()
Returns an array of outgoing transitions from this state. The returned array must not be changed.


equals

public boolean equals(Object obj)
Two states are equal if:

Overrides:
equals in class Object

hasChildren

public boolean hasChildren()
Return true if this state has any children (outgoing transitions).


isFinal

public boolean isFinal()
Is this state a final state in the automaton?


hashCode

public int hashCode()
Compute the hash code of the current status of this state.

Overrides:
hashCode in class Object

postOrder

public void postOrder(Visitor<? super State> v)
Visit all sub-states in post-order.

Specified by:
postOrder in interface Traversable<State>

preOrder

public void preOrder(Visitor<? super State> v)
Visit all sub-states in pre-order.

Specified by:
preOrder in interface Traversable<State>


Copyright © 2010. All Rights Reserved.