sem.graph
Class Edge

java.lang.Object
  extended by sem.graph.Edge

public class Edge
extends java.lang.Object

A directed edge from head to dependent, connecting two nodes.


Constructor Summary
Edge(java.lang.String label, Node head, Node dep)
          Create a new edge between two nodes.
 
Method Summary
 Node getDep()
          Get the dependent node.
 Node getHead()
          Get the head node.
 java.lang.String getLabel()
          Get the relation type of this edge.
 void print()
          Print the edge information to System.out.
 void setLabel(java.lang.String label)
          Set the relation type of this edge.
 java.lang.String toString()
          Create a string representation of the edge.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Edge

public Edge(java.lang.String label,
            Node head,
            Node dep)
Create a new edge between two nodes.

Parameters:
label - The relation type.
head - Head node.
dep - Dependent node.
Method Detail

getHead

public Node getHead()
Get the head node.

Returns:
Head node.

getDep

public Node getDep()
Get the dependent node.

Returns:
Dependent node.

getLabel

public java.lang.String getLabel()
Get the relation type of this edge.

Returns:
Relation type.

setLabel

public void setLabel(java.lang.String label)
Set the relation type of this edge.

Parameters:
label - Relation type.

print

public void print()
Print the edge information to System.out.


toString

public java.lang.String toString()
Create a string representation of the edge. Includes the label of the edge, the head and the dependent.

Overrides:
toString in class java.lang.Object