de.pado.dv
Class Edge

java.lang.Object
  extended by de.pado.dv.Edge

public class Edge
extends java.lang.Object

This class models an edge of a parse tree, that is an edge between two Nodes with a String label called relation.


Constructor Summary
Edge(Node fromNode, Node toNode, java.lang.String relation)
          Constructs an edge from two nodes an a label (relation).
 
Method Summary
 Node getFromNode()
          Get the node object at which the edge starts
 java.lang.String getRelation()
          Get the relation with which the edge is labelled
 Node getToNode()
          Get the node object at which the edge ends
 Edge invert()
          Returns a new edge which has the start and end nodes inversed.
 boolean matches(Edge e)
          Checks if two edges match.
 java.lang.String toString()
          Returns a string representation of the edge (equivalent to the edge part of a path specification)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Edge

public Edge(Node fromNode,
            Node toNode,
            java.lang.String relation)
Constructs an edge from two nodes an a label (relation).

Method Detail

getFromNode

public Node getFromNode()
Get the node object at which the edge starts


getToNode

public Node getToNode()
Get the node object at which the edge ends


getRelation

public java.lang.String getRelation()
Get the relation with which the edge is labelled


toString

public java.lang.String toString()
Returns a string representation of the edge (equivalent to the edge part of a path specification)

Overrides:
toString in class java.lang.Object

invert

public Edge invert()
Returns a new edge which has the start and end nodes inversed.


matches

public boolean matches(Edge e)
Checks if two edges match. This is true iff the start and end nodes of both edges match (see the Node class for details) and the relation matches. The relation matches iff the two relations are identical or one of them is "*". This method is used to check if an edge matches part of a path specification