public class TextWriterStream
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.lang.StringBuilder |
comment
Buffer for comment data to output.
|
static java.lang.String |
COMMENTSEP
Comment separator line.
|
private TextWriterWriterInterface<?> |
fallbackwriter
Fallback writer, using toString.
|
private java.lang.StringBuilder |
inline
Buffer for inline data to output.
|
private static java.lang.String |
NEWLINE
System newline character(s)
|
private java.io.PrintStream |
outStream
Actual stream to write to.
|
static java.lang.String |
QUOTE
String to separate different entries while printing.
|
static java.lang.String |
SEPARATOR
String to separate different entries while printing.
|
static java.lang.String |
SER_MARKER
Marker used in text serialization (and re-parsing)
|
private HandlerList<TextWriterWriterInterface<?>> |
writers
Handlers for various object types.
|
Constructor and Description |
---|
TextWriterStream(java.io.PrintStream out,
HandlerList<TextWriterWriterInterface<?>> writers,
TextWriterWriterInterface<?> fallback)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
commentPrint(java.lang.CharSequence line)
Print an object into the comments section
|
void |
commentPrint(java.lang.Object line)
Print an object into the comments section
|
void |
commentPrintLn()
Print a newline into the comments section.
|
void |
commentPrintLn(java.lang.CharSequence line)
Print an object into the comments section with trailing newline.
|
void |
commentPrintLn(java.lang.Object line)
Print an object into the comments section with trailing newline.
|
void |
commentPrintSeparator()
Print a separator line in the comments section.
|
void |
flush()
Flush output: write inline data, then write comment section.
|
TextWriterWriterInterface<?> |
getWriterFor(java.lang.Object o)
Retrieve an appropriate writer from the handler list.
|
void |
inlinePrint(java.lang.Object o)
Print data into the inline part of the file.
|
void |
inlinePrintNoQuotes(java.lang.Object o)
Print data into the inline part of the file WITHOUT checking for separators
(and thus quoting).
|
private void |
quotePrintln(java.io.PrintStream outStream,
java.lang.String data)
Quoted println.
|
private java.io.PrintStream outStream
private java.lang.StringBuilder inline
private java.lang.StringBuilder comment
private HandlerList<TextWriterWriterInterface<?>> writers
public static final java.lang.String SEPARATOR
public static final java.lang.String QUOTE
public static final java.lang.String COMMENTSEP
QUOTE
infront, it should be quoted string itself.private static final java.lang.String NEWLINE
public static final java.lang.String SER_MARKER
private TextWriterWriterInterface<?> fallbackwriter
public TextWriterStream(java.io.PrintStream out, HandlerList<TextWriterWriterInterface<?>> writers, TextWriterWriterInterface<?> fallback)
out
- Actual stream to write towriters
- Handlers for various data typesfallback
- Fallback writerpublic void commentPrint(java.lang.Object line)
line
- object to print into commmentspublic void commentPrint(java.lang.CharSequence line)
line
- object to print into commmentspublic void commentPrintLn(java.lang.CharSequence line)
line
- object to print into commentspublic void commentPrintLn(java.lang.Object line)
line
- object to print into commentspublic void commentPrintLn()
public void commentPrintSeparator()
public void inlinePrint(java.lang.Object o)
o
- object to printpublic void inlinePrintNoQuotes(java.lang.Object o)
o
- object to print.public void flush()
private void quotePrintln(java.io.PrintStream outStream, java.lang.String data)
QUOTE
outStream
- output stream to write todata
- data to printpublic TextWriterWriterInterface<?> getWriterFor(java.lang.Object o)
o
- query objectCopyright © 2019 ELKI Development Team. License information.