| jj2000.j2k.util.MsgLogger
All known Subclasses: com.sun.media.imageioimpl.plugins.jpeg2000.J2KImageReader, jj2000.j2k.util.StreamMsgLogger,
MsgLogger | public interface MsgLogger (Code) | | This class provides a simple common abstraction of a facility that logs
and/or displays messages or simple strings. The underlying facility can be
a terminal, text file, text area in a GUI display, dialog boxes in a GUI
display, etc., or a combination of those.
Messages are short strings (a couple of lines) that indicate some state
of the program, and that have a severity code associated with them (see
below). Simple strings is text (can be long) that has no severity code
associated with it. Typical use of simple strings is to display help texts.
Each message has a severity code, which can be one of the following:
LOG, INFO, WARNING, ERROR. Each implementation should treat each severity
code in a way which corresponds to the type of diplay used.
Messages are printed via the 'printmsg()' method. Simple strings are
printed via the 'print()', 'println()' and 'flush()' methods, each simple
string is considered to be terminated once the 'flush()' method has been
called. The 'printmsg()' method should never be called before a previous
simple string has been terminated.
|
Field Summary | |
final public static int | ERROR Severity of message. | final public static int | INFO Severity of message. | final public static int | LOG Severity of message. | final public static int | WARNING Severity of message. |
Method Summary | |
public void | flush() Writes any buffered data from the println() method to the device. | public void | println(String str, int flind, int ind) Prints the string 'str' to the output device, appending a line
return. | public void | printmsg(int sev, String msg) Prints the message 'msg' to the output device, appending a newline,
with severity 'sev'. |
ERROR | final public static int ERROR(Code) | | Severity of message. ERROR messages denote that something has gone
wrong and probably that execution has ended. They should be definetely
displayed to the user.
|
INFO | final public static int INFO(Code) | | Severity of message. INFO messages should be displayed just for user
feedback.
|
LOG | final public static int LOG(Code) | | Severity of message. LOG messages are just for bookkeeping and do not
need to be displayed in the majority of cases
|
WARNING | final public static int WARNING(Code) | | Severity of message. WARNING messages denote that an unexpected state
has been reached and should be given as feedback to the user.
|
flush | public void flush()(Code) | | Writes any buffered data from the println() method to the device.
|
println | public void println(String str, int flind, int ind)(Code) | | Prints the string 'str' to the output device, appending a line
return. The message is reformatted as appropriate to the particular
diplaying device, where 'flind' and 'ind' are used as hints for
performing that operation. However, any newlines appearing in 'str' are
respected. The output device may not display the string until flush()
is called. Some implementations may automatically flush when this
method is called. This method just prints the string, the string does
not make part of a "message" in the sense that no severity is
associated to it.
Parameters: str - The string to print Parameters: flind - Indentation of the first line Parameters: ind - Indentation of any other lines. |
printmsg | public void printmsg(int sev, String msg)(Code) | | Prints the message 'msg' to the output device, appending a newline,
with severity 'sev'. Some implementations where the appended newline is
irrelevant may not append the newline. Depending on the implementation
the severity of the message may be added to it. The message is
reformatted as appropriate for the output devic, but any newline
characters are respected.
Parameters: sev - The message severity (LOG, INFO, etc.) Parameters: msg - The message to display |
|
|