learner
Class TransitionTable

java.lang.Object
  extended by learner.TransitionTable

public class TransitionTable
extends java.lang.Object

The class TransitionTable allows for search and organisation of a set of transitions.


Constructor Summary
TransitionTable()
          Creates a new TranstionTable an initialises the transition set.
 
Method Summary
 void add(java.lang.String f, java.lang.String q)
          An abbreviation for add(String, Vector, String).
 void add(java.lang.String f, java.lang.String q1, java.lang.String q)
           
 void add(java.lang.String f, java.lang.String q1, java.lang.String q2, java.lang.String q)
           
 void add(java.lang.String f, java.lang.String q1, java.lang.String q2, java.lang.String q3, java.lang.String q)
           
 void add(java.lang.String f, java.lang.String q1, java.lang.String q2, java.lang.String q3, java.lang.String q4, java.lang.String q)
           
 void add(java.lang.String f, java.lang.String q1, java.lang.String q2, java.lang.String q3, java.lang.String q4, java.lang.String q5, java.lang.String q)
           
 void add(java.lang.String f, java.lang.String q1, java.lang.String q2, java.lang.String q3, java.lang.String q4, java.lang.String q5, java.lang.String q6, java.lang.String q)
           
 void add(java.lang.String f, java.util.Vector<java.lang.String> Q, java.lang.String q)
          Constructs a transition from the arguments and adds it to the transition set.
 void add(Transition transition)
          Adds a transtion to the transition set.
 java.util.LinkedHashSet<RankedSymbol> getSignature()
          Calculates the signature by inspecting the transition table.
 java.util.LinkedHashSet<java.lang.String> getStates()
          Calculates the set of states used by inspecting the transition table.
 java.lang.String lookup(RankedSymbol f, java.util.Vector<java.lang.String> states)
          The function lookup takes as argument the left hand side of a rule and finds the corresponding right hand side.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TransitionTable

public TransitionTable()
Creates a new TranstionTable an initialises the transition set.

Method Detail

add

public void add(Transition transition)
Adds a transtion to the transition set.

Parameters:
transition - The transition that is to be added to the set.

add

public void add(java.lang.String f,
                java.util.Vector<java.lang.String> Q,
                java.lang.String q)
Constructs a transition from the arguments and adds it to the transition set.

Parameters:
f - The input symbol as a string (without rank).
Q - A set of states.
q - The resulting state.

add

public void add(java.lang.String f,
                java.lang.String q)
An abbreviation for add(String, Vector, String).

Parameters:
f - A zero ranked symbol expressed as a string.
q - The resulting state.

add

public void add(java.lang.String f,
                java.lang.String q1,
                java.lang.String q)

add

public void add(java.lang.String f,
                java.lang.String q1,
                java.lang.String q2,
                java.lang.String q)

add

public void add(java.lang.String f,
                java.lang.String q1,
                java.lang.String q2,
                java.lang.String q3,
                java.lang.String q)

add

public void add(java.lang.String f,
                java.lang.String q1,
                java.lang.String q2,
                java.lang.String q3,
                java.lang.String q4,
                java.lang.String q)

add

public void add(java.lang.String f,
                java.lang.String q1,
                java.lang.String q2,
                java.lang.String q3,
                java.lang.String q4,
                java.lang.String q5,
                java.lang.String q)

add

public void add(java.lang.String f,
                java.lang.String q1,
                java.lang.String q2,
                java.lang.String q3,
                java.lang.String q4,
                java.lang.String q5,
                java.lang.String q6,
                java.lang.String q)

getStates

public java.util.LinkedHashSet<java.lang.String> getStates()
Calculates the set of states used by inspecting the transition table.

Returns:
A LinkedHashSet containing the states.

getSignature

public java.util.LinkedHashSet<RankedSymbol> getSignature()
Calculates the signature by inspecting the transition table.

Returns:
A LinkedHashSet conatining the signature.

lookup

public java.lang.String lookup(RankedSymbol f,
                               java.util.Vector<java.lang.String> states)
The function lookup takes as argument the left hand side of a rule and finds the corresponding right hand side. If no match is found, then the dead state is returned.

Parameters:
f - The ranked symbol that is the root of the left hand side.
states - The vector of states the form the subtrees of the left hand side.
Returns:
The resulting state, or if it does not exist, a dead state.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object