|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 | |
static int |
ERROR
Severity of message. |
static int |
INFO
Severity of message. |
static int |
LOG
Severity of message. |
static int |
WARNING
Severity of message. |
Method Summary | |
void |
flush()
Writes any buffered data from the println() method to the device. |
void |
println(java.lang.String str,
int flind,
int ind)
Prints the string 'str' to the output device, appending a line return. |
void |
printmsg(int sev,
java.lang.String msg)
Prints the message 'msg' to the output device, appending a newline, with severity 'sev'. |
Field Detail |
public static final int LOG
public static final int INFO
public static final int WARNING
public static final int ERROR
Method Detail |
public void printmsg(int sev, java.lang.String msg)
sev
- The message severity (LOG, INFO, etc.)msg
- The message to displaypublic void println(java.lang.String str, int flind, int ind)
str
- The string to printflind
- Indentation of the first lineind
- Indentation of any other lines.public void flush()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |