de.saar.chorus.domgraph.codec
Class OutputCodec

Object
  extended by OutputCodec
Direct Known Subclasses:
DomgraphUdrawOutputCodec, DotOutputCodec, MultiOutputCodec

public abstract class OutputCodec
extends Object

The abstract base class for all output codecs. Derived classes implement the method encode, which is responsible for writing an encoding of the labelled dominance graph to a writer.

Author:
Alexander Koller

Constructor Summary
OutputCodec()
           
 
Method Summary
abstract  void encode(DomGraph graph, NodeLabels labels, Writer writer)
          Encodes a dominance graph into a string representation for this output codec.
abstract  void print_footer(Writer writer)
          Prints a footer at the end of a file to which the USR is written.
abstract  void print_header(Writer writer)
          Prints a header at the beginning of a file to which the USR is written.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OutputCodec

public OutputCodec()
Method Detail

encode

public abstract void encode(DomGraph graph,
                            NodeLabels labels,
                            Writer writer)
                     throws IOException,
                            MalformedDomgraphException
Encodes a dominance graph into a string representation for this output codec. The dominance graph is defined by the arguments graph and labels. The USR is written to the writer.

Parameters:
graph - the dominance graph
labels - the node labels for this dominance graph
writer - the writer to which the encoded USR will be written
Throws:
IOException - if an I/O error occurred while writing to the writer
MalformedDomgraphException - if the graph cannot be encoded by this codec

print_header

public abstract void print_header(Writer writer)
                           throws IOException
Prints a header at the beginning of a file to which the USR is written.

Parameters:
writer - the writer
Throws:
IOException - if an I/O error occurred

print_footer

public abstract void print_footer(Writer writer)
                           throws IOException
Prints a footer at the end of a file to which the USR is written.

Parameters:
writer - the writer
Throws:
IOException - if an I/O error occurred