de.hpi.fgis.dude.output
Class SimpleTextOutput

java.lang.Object
  extended by de.hpi.fgis.dude.output.AbstractDuDeOutput
      extended by de.hpi.fgis.dude.output.SimpleTextOutput
All Implemented Interfaces:
DuDeOutput, AutoJsonable, Jsonable

public class SimpleTextOutput
extends AbstractDuDeOutput

SimpleTextOutput writes the passed DuDeObject pair to an OutputStream line by line.

Author:
Matthias Pohl

Field Summary
static String DEFAULT_SEPARATOR
          The default separator string that is used for separating both DuDeObjects, if no separator string is passed.
 
Fields inherited from class de.hpi.fgis.dude.output.AbstractDuDeOutput
outputStream
 
Constructor Summary
protected SimpleTextOutput()
          Internal constructor for Jsonable deserialization.
  SimpleTextOutput(File out)
          Initializes a new SimpleTextOutput with the passed parameters.
  SimpleTextOutput(File out, String hdr)
          Initializes a new SimpleTextOutput with the passed parameters.
  SimpleTextOutput(File out, String hdr, String ftr)
          Initializes a new SimpleTextOutput with the passed parameters.
  SimpleTextOutput(OutputStream out)
          Initializes a new SimpleTextOutput with the passed parameters.
  SimpleTextOutput(OutputStream out, String hdr)
          Initializes a new SimpleTextOutput with the passed parameters.
  SimpleTextOutput(OutputStream out, String hdr, String ftr)
          Initializes a new SimpleTextOutput with the passed parameters.
 
Method Summary
 void write(DuDeObjectPair pair)
          Writes the DuDeObject pair line by line.
 
Methods inherited from class de.hpi.fgis.dude.output.AbstractDuDeOutput
close, fromJson, getDefaultFooter, getDefaultHeader, printDataEnabled, toJson, withData, withoutData, writeDuplicatesOnly, writelnToStream, writeToStream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_SEPARATOR

public static final String DEFAULT_SEPARATOR
The default separator string that is used for separating both DuDeObjects, if no separator string is passed.

See Also:
Constant Field Values
Constructor Detail

SimpleTextOutput

public SimpleTextOutput(OutputStream out)
                 throws IOException
Initializes a new SimpleTextOutput with the passed parameters.

Parameters:
out - The OutputStream where the data is written to.
Throws:
IOException - If an error occurs while accessing the OutputStream.

SimpleTextOutput

public SimpleTextOutput(OutputStream out,
                        String hdr)
                 throws IOException
Initializes a new SimpleTextOutput with the passed parameters.

Parameters:
out - The OutputStream where the data is written to.
hdr - The header that will be written in front of the actual data.
Throws:
IOException - If an error occurs while accessing the OutputStream.

SimpleTextOutput

public SimpleTextOutput(OutputStream out,
                        String hdr,
                        String ftr)
                 throws IOException
Initializes a new SimpleTextOutput with the passed parameters.

Parameters:
out - The OutputStream where the data is written to.
hdr - The header that will be written in front of the actual data.
ftr - The footer that will be written after the actual data.
Throws:
IOException - If an error occurs while accessing the OutputStream.

SimpleTextOutput

public SimpleTextOutput(File out)
                 throws IOException
Initializes a new SimpleTextOutput with the passed parameters.

Parameters:
out - The File where the data is written to.
Throws:
IOException - If an error occurs while accessing the File.

SimpleTextOutput

public SimpleTextOutput(File out,
                        String hdr)
                 throws IOException
Initializes a new SimpleTextOutput with the passed parameters.

Parameters:
out - The File where the data is written to.
hdr - The header that will be written in front of the actual data.
Throws:
IOException - If an error occurs while accessing the File.

SimpleTextOutput

public SimpleTextOutput(File out,
                        String hdr,
                        String ftr)
                 throws IOException
Initializes a new SimpleTextOutput with the passed parameters.

Parameters:
out - The File where the data is written to.
hdr - The header that will be written in front of the actual data.
ftr - The footer that will be written after the actual data.
Throws:
IOException - If an error occurs while accessing the File.

SimpleTextOutput

protected SimpleTextOutput()
Internal constructor for Jsonable deserialization.

Method Detail

write

public void write(DuDeObjectPair pair)
           throws IOException
Writes the DuDeObject pair line by line.

Specified by:
write in interface DuDeOutput
Specified by:
write in class AbstractDuDeOutput
Parameters:
pair - A pair of two DuDeObjects that are written into an OutputStream.
Throws:
IOException - If an error occurs while writing onto the stream.


Copyright © 2011 Hasso Plattner Institute - Chair of Information Systems. All Rights Reserved.