edu.uci.eecs.doc.cascade.graph
Class AbstractGraphWriter

java.lang.Object
  extended by edu.uci.eecs.doc.cascade.graph.AbstractGraphWriter
All Implemented Interfaces:
GraphWriter
Direct Known Subclasses:
DOTWriter, GMLWriter, GraphMLWriter

public abstract class AbstractGraphWriter
extends Object
implements GraphWriter

An abstract base class for exporting a control flow graph to various output formats.

Author:
Trevor Harmon

Field Summary
protected  EdgeIDProvider edgeIDProvider
           
protected  EdgeLabelProvider edgeLabelProvider
           
protected  Graph graph
           
protected  VertexIDProvider vertexIDProvider
           
protected  VertexLabelProvider vertexLabelProvider
           
 
Constructor Summary
AbstractGraphWriter(Graph graph)
          Creates a new GraphWriter object.
AbstractGraphWriter(Graph graph, VertexIDProvider vertexIDProvider, VertexLabelProvider vertexLabelProvider, EdgeIDProvider edgeIDProvider, EdgeLabelProvider edgeLabelProvider)
          Creates a new GraphWriter object.
 
Method Summary
 void write(String filename)
          Exports the control flow graph to the specified file.
abstract  void write(Writer out)
          Exports the control flow graph to the specified output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

graph

protected final Graph graph

vertexIDProvider

protected VertexIDProvider vertexIDProvider

vertexLabelProvider

protected VertexLabelProvider vertexLabelProvider

edgeIDProvider

protected EdgeIDProvider edgeIDProvider

edgeLabelProvider

protected EdgeLabelProvider edgeLabelProvider
Constructor Detail

AbstractGraphWriter

public AbstractGraphWriter(Graph graph)
Creates a new GraphWriter object. Default IDs and labels will be provided for the vertices and edges of the graph.

Parameters:
graph - the control flow graph to be exported

AbstractGraphWriter

public AbstractGraphWriter(Graph graph,
                           VertexIDProvider vertexIDProvider,
                           VertexLabelProvider vertexLabelProvider,
                           EdgeIDProvider edgeIDProvider,
                           EdgeLabelProvider edgeLabelProvider)
Creates a new GraphWriter object.

Parameters:
graph - the control flow graph to be exported
vertexIDProvider - for generating vertex IDs
vertexLabelProvider - for generating vertex labels
edgeIDProvider - for generating edge IDs
edgeLabelProvider - for generating edge labels
Method Detail

write

public void write(String filename)
           throws IOException
Exports the control flow graph to the specified file.

Specified by:
write in interface GraphWriter
Parameters:
filename - the name of a file in which to save the graph
Throws:
IOException - if the graph cannot be written to disk

write

public abstract void write(Writer out)
                    throws IOException
Exports the control flow graph to the specified output stream.

Specified by:
write in interface GraphWriter
Parameters:
out - an output stream in which to save the graph
Throws:
IOException - if the graph cannot be written to the stream