Package de.saar.chorus.domgraph.codec
Class OutputCodec
java.lang.Object
de.saar.chorus.domgraph.codec.OutputCodec
- Direct Known Subclasses:
DomgraphUdrawOutputCodec,DotOutputCodec,MultiOutputCodec
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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidencode(DomGraph graph, NodeLabels labels, Writer writer) Encodes a dominance graph into a string representation for this output codec.abstract voidprint_footer(Writer writer) Prints a footer at the end of a file to which the USR is written.abstract voidprint_header(Writer writer) Prints a header at the beginning of a file to which the USR is written.
-
Constructor Details
-
OutputCodec
public OutputCodec()
-
-
Method Details
-
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 argumentsgraphandlabels. The USR is written to thewriter.- Parameters:
graph- the dominance graphlabels- the node labels for this dominance graphwriter- the writer to which the encoded USR will be written- Throws:
IOException- if an I/O error occurred while writing to thewriterMalformedDomgraphException- if the graph cannot be encoded by this codec
-
print_header
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
-