org.jscience.biology.lsystems.common
Class Log

java.lang.Object
  extended by org.jscience.biology.lsystems.common.Log

public class Log
extends java.lang.Object

This class handles all the error messages, warnings and infos. It throws exceptions if the error makes it impossible to proceed the program. All the error messages are stored in this class. Debugging info can easily be turned off in the member funtction debug.


Field Summary
static int INVALID_PRED
          The predecessor is invalid.
static int INVALID_SIGN
          An invalid sign is found in the axiom or rule
static int NO_FILE
          All definitions are used as error code.
static int NO_RULESIGN
          No sign for the rule has been found
 
Constructor Summary
Log()
           
 
Method Summary
static void debug(java.lang.String strDebug)
          This is used to output debugging information.
static void log(java.lang.String strOut)
          Prints the line to the standard out.
static void log(java.lang.String strInfo, int iErrorCode)
          Use this function to log an error.
static void log(java.lang.String strInfo, int iErrorCode, boolean bThrow)
          Use this function to log an error and then throw an exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_FILE

public static final int NO_FILE
All definitions are used as error code. Use this one if no file can be found

See Also:
Constant Field Values

INVALID_SIGN

public static final int INVALID_SIGN
An invalid sign is found in the axiom or rule

See Also:
Constant Field Values

INVALID_PRED

public static final int INVALID_PRED
The predecessor is invalid. Too long or not a letter

See Also:
Constant Field Values

NO_RULESIGN

public static final int NO_RULESIGN
No sign for the rule has been found

See Also:
Constant Field Values
Constructor Detail

Log

public Log()
Method Detail

log

public static void log(java.lang.String strOut)
Prints the line to the standard out.

Parameters:
strOut - The string to print.

log

public static void log(java.lang.String strInfo,
                       int iErrorCode,
                       boolean bThrow)
                throws java.lang.Exception
Use this function to log an error and then throw an exception. This is use if the program can not be continued due to the error.

Parameters:
strInfo - Supplemental information of the error.
iErrorCode - The type of the error matching the defined value.
bThrow - Specify if an exception shall be thrown or not. If not the calling method must handle the exception anyways.
Throws:
java.lang.Exception - An exception containing the error information.

log

public static void log(java.lang.String strInfo,
                       int iErrorCode)
Use this function to log an error.

Parameters:
strInfo - Supplemental information of the error.
iErrorCode - The type of the error matching the defined value.

debug

public static void debug(java.lang.String strDebug)
This is used to output debugging information. It can be easily removed in a final version of the program.

Parameters:
strDebug - The string to output.