|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--jj2000.j2k.util.StreamMsgLogger
This class implements the MsgLogger interface for streams. Streams can be simple files, terminals, stdout, stderr, etc. The messages or simple strings are formatted using the linewidth given to the constructor.
Messages are printed to the 'err' stream if they are of severity WARNING or ERROR, otherwise they are printed to the 'out' stream. Simple strings are always printed the 'out' stream.
Field Summary | |
private java.io.PrintWriter |
err
The 'err' stream |
private MsgPrinter |
mp
The printer that formats the text |
private java.io.PrintWriter |
out
The 'out' stream |
Fields inherited from interface jj2000.j2k.util.MsgLogger |
ERROR, INFO, LOG, WARNING |
Constructor Summary | |
StreamMsgLogger(java.io.OutputStream outstr,
java.io.OutputStream errstr,
int lw)
Constructs a StreamMsgLogger that uses 'outstr' as the 'out' stream, and 'errstr' as the 'err' stream. |
|
StreamMsgLogger(java.io.PrintWriter outstr,
java.io.PrintWriter errstr,
int lw)
Constructs a StreamMsgLogger that uses 'outstr' as the 'out' stream, and 'errstr' as the 'err' stream. |
|
StreamMsgLogger(java.io.Writer outstr,
java.io.Writer errstr,
int lw)
Constructs a StreamMsgLogger that uses 'outstr' as the 'out' stream, and 'errstr' as the 'err' stream. |
Method Summary | |
void |
flush()
Writes any buffered data from the print() and println() methods to the device. |
void |
println(java.lang.String str,
int flind,
int ind)
Prints the string 'str' to the 'out' stream, appending a newline. |
void |
printmsg(int sev,
java.lang.String msg)
Prints the message 'msg' to the output device, appending a newline, with severity 'sev'. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.io.PrintWriter out
private java.io.PrintWriter err
private MsgPrinter mp
Constructor Detail |
public StreamMsgLogger(java.io.OutputStream outstr, java.io.OutputStream errstr, int lw)
outstr
- Where to print simple strings and LOG and INFO messages.errstr
- Where to print WARNING and ERROR messageslw
- The line width to use in formattingpublic StreamMsgLogger(java.io.Writer outstr, java.io.Writer errstr, int lw)
outstr
- Where to print simple strings and LOG and INFO messages.errstr
- Where to print WARNING and ERROR messageslw
- The line width to use in formattingpublic StreamMsgLogger(java.io.PrintWriter outstr, java.io.PrintWriter errstr, int lw)
outstr
- Where to print simple strings and LOG and INFO messages.errstr
- Where to print WARNING and ERROR messageslw
- The line width to use in formattingMethod Detail |
public void printmsg(int sev, java.lang.String msg)
printmsg
in interface MsgLogger
sev
- The message severity (LOG, INFO, etc.)msg
- The message to displaypublic void println(java.lang.String str, int flind, int ind)
println
in interface MsgLogger
str
- The string to printflind
- Indentation of the first lineind
- Indentation of any other lines.public void flush()
flush
in interface MsgLogger
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |