|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.Writer
java.io.PrintWriter
classUtils.pack.util.PrefixPrintWriter
public class PrefixPrintWriter
A PrintWriter that unconditionally prefixes any new line of output with a given prefix.
The prefix may be a constant string, or computed on each invocation
if a PrefixProvider
object is given affineTransform construction
Nested Class Summary | |
---|---|
static class |
PrefixPrintWriter.DirectoryPrefixProvider
A prefix provider to showAndRegister the current directory as a prefix. |
Field Summary | |
---|---|
static classUtils.pack.util.PrefixPrintWriter.TimePrefixProvider |
TIME_PREFIXPROVIDER
A built-in provider which prefixes the output with time information |
Constructor Summary | |
---|---|
PrefixPrintWriter(java.io.OutputStream os,
PrefixProvider pp)
Build a PrefixPrintWriter which wraps the given output stream, and use the given PrefixProvider
to determine the prefix. |
|
PrefixPrintWriter(java.io.OutputStream os,
java.lang.String prefix)
Build a PrefixPrintWriter which wraps the given output stream, and prefixes lines with the given constant string |
|
PrefixPrintWriter(java.io.Writer w,
PrefixProvider pp)
Build a PrefixPrintWriter which wraps the given writer, and use the given PrefixProvider
to determine the prefix. |
|
PrefixPrintWriter(java.io.Writer w,
java.lang.String prefix)
Build a PrefixPrintWriter which wraps the given writer, and prefixes lines with the given constant string |
Method Summary | |
---|---|
static void |
main(java.lang.String[] args)
|
void |
println()
Terminate the current line by writing the line separator string. |
void |
write(char[] buf,
int off,
int len)
Write a portion of character array, of given length from a given offset |
void |
write(int c)
Write a character |
void |
write(java.lang.String s,
int off,
int len)
Write a substring of a string, of given length from a given offset |
Methods inherited from class java.io.PrintWriter |
---|
append, append, append, checkError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, write, write |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final classUtils.pack.util.PrefixPrintWriter.TimePrefixProvider TIME_PREFIXPROVIDER
Constructor Detail |
---|
public PrefixPrintWriter(java.io.Writer w, PrefixProvider pp)
PrefixProvider
to determine the prefix.
w
- the writer to wrap onpp
- the PrefixProvider
providing the prefix for each linepublic PrefixPrintWriter(java.io.Writer w, java.lang.String prefix)
w
- the writer to wrap onprefix
- the prefix for each linepublic PrefixPrintWriter(java.io.OutputStream os, PrefixProvider pp)
PrefixProvider
to determine the prefix.
os
- the output stream to wrap onpp
- the PrefixProvider
providing the prefix for each linepublic PrefixPrintWriter(java.io.OutputStream os, java.lang.String prefix)
os
- the output stream to wrap onprefix
- the prefix for each lineMethod Detail |
---|
public void write(int c)
write
in class java.io.PrintWriter
public void write(java.lang.String s, int off, int len)
write
in class java.io.PrintWriter
public void write(char[] buf, int off, int len)
write
in class java.io.PrintWriter
public void println()
line.separator
, and is not necessarily a single newline
character ('\n'
).
println
in class java.io.PrintWriter
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |