|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.lmu.ifi.dbs.elki.result.textwriter.TextWriterStream
public class TextWriterStream
Representation of an output stream to a text file.
Field Summary | |
---|---|
private StringBuffer |
comment
Buffer for comment data to output. |
static String |
COMMENTSEP
Comment separator line. |
private boolean |
forceincomments
Force incomments flag |
private StringBuffer |
inline
Buffer for inline data to output. |
private static String |
NEWLINE
System newline character(s) |
private PrintStream |
outStream
Actual stream to write to. |
static String |
QUOTE
String to separate different entries while printing. |
static String |
SEPARATOR
String to separate different entries while printing. |
static String |
SER_MARKER
Marker used in text serialization (and re-parsing) |
private HandlerList<TextWriterWriterInterface<?>> |
writers
Handlers for various object types. |
Constructor Summary | |
---|---|
TextWriterStream(PrintStream out,
HandlerList<TextWriterWriterInterface<?>> writers)
Constructor. |
Method Summary | ||
---|---|---|
void |
commentPrint(Object line)
Print an object into the comments section |
|
void |
commentPrintLn()
Print a newline into the comments section. |
|
void |
commentPrintLn(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(Object o)
Retrieve an appropriate writer from the handler list. |
|
void |
inlinePrint(Object o)
Print data into the inline part of the file. |
|
void |
inlinePrintNoQuotes(Object o)
Print data into the inline part of the file WITHOUT checking for separators (and thus quoting). |
|
protected boolean |
isForceincomments()
Test force-in-comments flag. |
|
|
normalizationRestore(O v)
Restore a vector undoing any normalization that was applied. |
|
private void |
quotePrintln(PrintStream outStream,
String data)
Quoted println. |
|
protected void |
setForceincomments(boolean forceincomments)
Set the force-in-comments flag. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private PrintStream outStream
private StringBuffer inline
private StringBuffer comment
private HandlerList<TextWriterWriterInterface<?>> writers
public static final String SEPARATOR
public static final String QUOTE
public static final String COMMENTSEP
QUOTE
infront, it should be quoted string itself.
private static final String NEWLINE
public static final String SER_MARKER
private boolean forceincomments
Constructor Detail |
---|
public TextWriterStream(PrintStream out, HandlerList<TextWriterWriterInterface<?>> writers)
out
- Actual stream to write towriters
- Handlers for various data typesMethod Detail |
---|
public void commentPrint(Object line)
line
- object to print into commmentspublic void commentPrintLn(Object line)
line
- object to print into commentspublic void commentPrintLn()
public void commentPrintSeparator()
public void inlinePrint(Object o)
o
- object to printpublic void inlinePrintNoQuotes(Object o)
o
- object to print.public void flush()
private void quotePrintln(PrintStream outStream, String data)
QUOTE
outStream
- output stream to write todata
- data to printpublic TextWriterWriterInterface<?> getWriterFor(Object o)
o
- query object
public <O> O normalizationRestore(O v)
O
- Object classv
- vector to restore
protected boolean isForceincomments()
protected void setForceincomments(boolean forceincomments)
forceincomments
- the new flag value
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |