netkit.graph.io
Class EdgeReaderGDA

java.lang.Object
  extended by netkit.graph.io.EdgeReaderGDA

public final class EdgeReaderGDA
extends java.lang.Object

This class reads in Edge data in the GDA format. This format specifies that the input is a two column comma separated table. The first line is the table header. In subsequent lines, column 1 is the link or Edge identifier and column 2 is one of the (possibly many) Nodes this Edge refers to. GDA Edge indentifiers represent collapsed meta-Edges where every Node within an indentifier group is connected to every other Node within that group. All Edges are undirected. Lines may contain comments which are lines where a '%' or '#' appears as the first character. Comments are terminated by the end-of-line.

Author:
Kaveh R. Ghazi
See Also:
SchemaReader, Graph, Node, Edge, EdgeType

Constructor Summary
EdgeReaderGDA()
           
 
Method Summary
static void readEdges(java.io.Reader reader, Graph graph, EdgeType et)
          Reads Edges from the supplied Reader and creates the corresponding Edges in the Graph; Edges are validated by the supplied EdgeType which must have identical source and destination Node types, and the Nodes these Edges refer to must already exist in the Graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EdgeReaderGDA

public EdgeReaderGDA()
Method Detail

readEdges

public static void readEdges(java.io.Reader reader,
                             Graph graph,
                             EdgeType et)
Reads Edges from the supplied Reader and creates the corresponding Edges in the Graph; Edges are validated by the supplied EdgeType which must have identical source and destination Node types, and the Nodes these Edges refer to must already exist in the Graph.

Parameters:
reader - a Reader object containing Edge instances for the graph.
graph - a Graph object into which Edges will be inserted.
et - an EdgeType for Edges read from the Reader.
Throws:
java.lang.RuntimeException - if any of the format constraints of the input are violated.