nl.telin.mymedia.apolda
Class FSMState

java.lang.Object
  extended by nl.telin.mymedia.apolda.FSMState
All Implemented Interfaces:
java.io.Serializable

public class FSMState
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Field Summary
protected  int myIndex
          The unique id of this state.
protected  java.util.Set termSet
           
protected  CharMap transitionFunction
          The transition function of this state.
 
Constructor Summary
FSMState()
          Constructs a new FSMState object and adds it to the list of states of the DefaultGazetteer provided as owner.
 
Method Summary
 void addTerm(Term term)
          Adds a new term description to this state's term descriptions set
 java.lang.String getEdgesGML()
          Returns a GML (Graph Modeling Language) representation of the edges emerging from this state.
 int getIndex()
          Returns the unique ID of this state.
 java.util.Set<Term> getTermSet()
          Returns a set of Term objects describing the types of lookups the phrase for which this state is the final one belongs to
 boolean isFinal()
          Checks whether this state is a final one
 FSMState next(char chr)
          This method is used to access the transition function of this state.
 void put(char chr, FSMState state)
          Adds a new value to the transition function
 void removeTerm(Term term)
          Removes a term description from this state's term descriptions set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

transitionFunction

protected CharMap transitionFunction
The transition function of this state.


termSet

protected java.util.Set termSet

myIndex

protected int myIndex
The unique id of this state. This value is never used by the algorithms but it can be useful for graphical representations.

Constructor Detail

FSMState

public FSMState()
Constructs a new FSMState object and adds it to the list of states of the DefaultGazetteer provided as owner.

Parameters:
owner - a DefaultGazetteer object
Method Detail

put

public void put(char chr,
                FSMState state)
Adds a new value to the transition function


next

public FSMState next(char chr)
This method is used to access the transition function of this state.


getEdgesGML

public java.lang.String getEdgesGML()
Returns a GML (Graph Modeling Language) representation of the edges emerging from this state.


isFinal

public boolean isFinal()
Checks whether this state is a final one


getTermSet

public java.util.Set<Term> getTermSet()
Returns a set of Term objects describing the types of lookups the phrase for which this state is the final one belongs to


addTerm

public void addTerm(Term term)
Adds a new term description to this state's term descriptions set


removeTerm

public void removeTerm(Term term)
Removes a term description from this state's term descriptions set


getIndex

public int getIndex()
Returns the unique ID of this state.