Class DfaVertex

java.lang.Object
  extended by DfaVertex

public class DfaVertex
extends java.lang.Object

A DfaVertex object models a single vertex in a dfa. This includes a label for the vertex, such as Q0, Q1, or Q2, and a set of transitions from the vertex to other vertices.


Constructor Summary
DfaVertex(java.lang.String label)
          Create a new vertex with the given label.
 
Method Summary
 void addTransition(java.lang.String symbol, java.lang.String dest)
          Add a new transition from this vertex to some other, destination vertex.
 java.lang.String getLabel()
          return the label of this vertex
 java.lang.String getTransition(java.lang.String symbol)
          Find out the destination vertex to which the given symbol will cause a transition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DfaVertex

public DfaVertex(java.lang.String label)
Create a new vertex with the given label. (e.g. Q0, Q1, Q2)

Method Detail

addTransition

public void addTransition(java.lang.String symbol,
                          java.lang.String dest)
Add a new transition from this vertex to some other, destination vertex.

Parameters:
symbol - the symbol (e.g. a,b,c) that causes the transition
dest - the label of the destination vertex for the transition

getTransition

public java.lang.String getTransition(java.lang.String symbol)
Find out the destination vertex to which the given symbol will cause a transition.

Parameters:
symbol - the symbol (e.g. a,b,c) that causes the transition
Returns:
the label of the destination vertex for the transition

getLabel

public java.lang.String getLabel()
return the label of this vertex