|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MathPrinter
This interface describes the mechanism by which the MathTools classes communicate with external applications. It provides a very basic logging framework, a general-purpose print method, and a generic processMathObject() method.
The logging framework is not intended to be a comprehensive logging package. Rather, it represents the minimum equipment needed to debug MathTools apps and to report error conditions within the MathTools classes themselves.
The mathPrintln() and processMathObject() methods provide a non-logging way to communicate with applications. mathPrintln() is designed to print messages outside the logging framework. The processMathObject() method is designed to provide a very generic way for a customized MathPrinter to process something defined by the application implementing it.
Operationally, a MathPrinter works in conjunction with CapCom. CapCom implements all MathPrinter methods (but NOT the interface itself!) and the MathTools classes that generate logging messages all report to CapCom. CapCom contains a method to set a global MathPrinter and, if one is set, all log, print and processMathObject() calls are directed to it. If no MathPrinter is set, CapCom silently ignores all such calls. Most of the classes in the demo package also utilize the Global Printer for their output, so adding them to other applications will require a Global Printer!
Field Summary | |
---|---|
static byte |
LOG_DEBUG
Debug is used to report internal conditions within MathTools classes. |
static byte |
LOG_ERROR
Error level represents a serious problem that may terminate program execution. |
static byte |
LOG_INFO
Info-level logging is for messages of interest but not necessarily a program-threatening nature. |
Method Summary | |
---|---|
void |
mathLog(byte pLevel,
java.lang.String pMesg,
java.lang.Throwable pThr)
This method provides a connection for MathTools to log errors and information. |
void |
mathPrintln(java.lang.String pMesg)
Print a message to something that will be read either immediately or later. |
java.lang.Object |
processMathObject(java.lang.Object pData)
This method provides a basic, generic extension point for custom MathPrinter implementations. |
Field Detail |
---|
static final byte LOG_INFO
static final byte LOG_DEBUG
static final byte LOG_ERROR
Method Detail |
---|
void mathLog(byte pLevel, java.lang.String pMesg, java.lang.Throwable pThr)
pLevel
- One of the LOG_ levels defined above.pMesg
- A String message describing the event.pThr
- A Throwable generated by the event. May be null.void mathPrintln(java.lang.String pMesg)
pMesg
- The String message to be printed.java.lang.Object processMathObject(java.lang.Object pData)
pData
- The data to be processed.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |