de.pado.dv
Class Graph

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

public class Graph
extends java.lang.Object

This class models the graph that contains the dependency parsing information for a sentence (one paragraph of input data).


Constructor Summary
Graph()
          Initialise an empty graph.
 
Method Summary
 void addEdge(Edge thisEdge)
          Add an edge to the Graph.
 void addNode(Node node)
          Add a node to the graph
 java.util.Set getAllNodeIndices()
          Returns the set of all node indices in the Graph.
 java.util.HashMap getEdges(java.lang.Integer vertice)
          Returns all edges for a given node
 Node getNode(java.lang.Integer index)
          Get a node from the Graph.
 boolean isEmpty()
          Checks if there are no edges in the Graph.
 void replaceBy(java.lang.Integer oldID, java.lang.Integer newID)
          Replace all occurrences of some index in the Graph by a new index.
 java.lang.String toString()
          return a string representation of the graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Graph

public Graph()
Initialise an empty graph.

Method Detail

addNode

public void addNode(Node node)
Add a node to the graph


getNode

public Node getNode(java.lang.Integer index)
Get a node from the Graph. Throws an UnknownNodeException if an invalid index is being used.


addEdge

public void addEdge(Edge thisEdge)
Add an edge to the Graph.


getEdges

public java.util.HashMap getEdges(java.lang.Integer vertice)
Returns all edges for a given node


getAllNodeIndices

public java.util.Set getAllNodeIndices()
Returns the set of all node indices in the Graph.


replaceBy

public void replaceBy(java.lang.Integer oldID,
                      java.lang.Integer newID)
Replace all occurrences of some index in the Graph by a new index. This method does not check if the new ID is already in use.


isEmpty

public boolean isEmpty()
Checks if there are no edges in the Graph.


toString

public java.lang.String toString()
return a string representation of the graph. This has only been used for debugging purposes.

Overrides:
toString in class java.lang.Object