org.gersteinlab.tyna.core.io
Interface GraphReader

All Known Implementing Classes:
CSVIO, SIFIO, TDIO

public interface GraphReader

        This interface declares that each implemented class is a graph reader
        that creates a graph from an input stream or a reader.
        

Version:
1.0 (September 20, 2005) Change History: 1.0 - Initial version
Author:
Kevin Yuk-Lap Yip

Method Summary
 Graph readGraph(java.io.InputStream in, boolean isDirected, boolean isMultigraph)
          Read the graph from an input stream.
 Graph readGraph(java.io.Reader in, boolean isDirected, boolean isMultigraph)
          Read the graph from a reader.
 

Method Detail

readGraph

Graph readGraph(java.io.InputStream in,
                boolean isDirected,
                boolean isMultigraph)
                throws GraphTypeException,
                       java.io.IOException,
                       InputFormatException
Read the graph from an input stream. The class of the returned object depends on the input values of isDirected and isMulti. If isDirected is true, the returned object is an instance of DirectedGraph. Otherwise, it is an instance of UndirectedGraph. If isMulti is true, the returned object is an instance of MultiGraph. Otherwise, it is an instance of SimpleGraph. The method does not close the input stream.

Parameters:
in - The input stream
isDirected - Whether the graph is to be directed
isMultigraph - Whether the graph is to be a multigraph
Returns:
The graph being read
Throws:
java.io.IOException - When there is an IO error
GraphTypeException - When the graph type does not match requirements
InputFormatException - When the input format is invalid

readGraph

Graph readGraph(java.io.Reader in,
                boolean isDirected,
                boolean isMultigraph)
                throws GraphTypeException,
                       java.io.IOException,
                       InputFormatException
Read the graph from a reader. The class of the returned object depends on the input values of isDirected and isMulti. If isDirected is true, the returned object is an instance of DirectedGraph. Otherwise, it is an instance of UndirectedGraph. If isMulti is true, the returned object is an instance of MultiGraph. Otherwise, it is an instance of SimpleGraph. The method does not close the reader.

Parameters:
in - The reader
isDirected - Whether the graph is to be directed
isMultigraph - Whether the graph is to be a multigraph
Returns:
The graph being read
Throws:
java.io.IOException - When there is an IO error
GraphTypeException - When the graph type does not match requirements
InputFormatException - When the input format is invalid