Class NpdaVertex

java.lang.Object
  extended by NpdaVertex

public class NpdaVertex
extends java.lang.Object

A NpdaVertex object models a single vertex in an npda. 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
NpdaVertex(java.lang.String label)
          Create a new vertex with the given label.
 
Method Summary
 void addTransition(NpdaTransition transition)
          Add a new transition from this vertex to some other, destination vertex.
 boolean equals(java.lang.Object obj)
           
 java.lang.String getLabel()
          return the label of this vertex
 java.util.Set<NpdaTransition> getTransitions(char readSymbol, char popSymbol)
          Compute and return the set of all valid transitions that could be taken from this vertex, assuming we have just read the given readSymbol from the input string and popped the given popSymbol from the stack.
 int hashCode()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NpdaVertex

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

Method Detail

addTransition

public void addTransition(NpdaTransition transition)
Add a new transition from this vertex to some other, destination vertex.

Parameters:
transition - the transition to be added

getTransitions

public java.util.Set<NpdaTransition> getTransitions(char readSymbol,
                                                    char popSymbol)
Compute and return the set of all valid transitions that could be taken from this vertex, assuming we have just read the given readSymbol from the input string and popped the given popSymbol from the stack.

Parameters:
readSymbol - a symbol that has just being read from the input string
popSymbol - a symbol that has just been popped from the stack
Returns:
the set of valid transitions will be given readSymbol and popSymbol

getLabel

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


hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object