public class AlgebraStringRepresentationOutputCodec<E> extends OutputCodec<E>
Algebra.representAsString(java.lang.Object)
method
to encode an object as a string. For most algebras, this has the same behavior as the
ToStringOutputCodec
; but a few algebras (e.g. StringAlgebra
) overwrite
this method.
Because the codec requires an algebra object to be instantiated, we do not add it
to the list of registered output codecs, and it will not be returned by
OutputCodec.getAllOutputCodecs()
and related methods.
Constructor and Description |
---|
AlgebraStringRepresentationOutputCodec(Algebra<E> algebra) |
Modifier and Type | Method and Description |
---|---|
void |
write(E object,
OutputStream ostream)
Writes a string representation of a given object to an output stream.
|
addOptions, asString, asStringSupplier, getAllOutputCodecs, getMetadata, getOption, getOutputCodecByExtension, getOutputCodecByName, getOutputCodecs, hasTrueOption
public void write(E object, OutputStream ostream) throws IOException, UnsupportedOperationException
OutputCodec
write
in class OutputCodec<E>
IOException
- if something went wrong with I/OUnsupportedOperationException
- if a problem occurred in computing
the representation of the objectCopyright © 2017. All rights reserved.