com.zwares.base.util
Class IO

java.lang.Object
  |
  +--com.zwares.base.util.IO

public class IO
extends java.lang.Object

This class can be used as debugging / error reporting tool.


Field Summary
protected static boolean DEBUG
           
protected static boolean ERROR
           
protected static java.io.PrintStream out
           
protected static boolean WARN
           
 
Constructor Summary
IO(boolean debug, boolean warning, boolean error)
          Creates a new IO class.
IO(boolean debug, boolean warning, boolean error, java.io.PrintStream out)
          Creates a new IO class.
IO(java.io.PrintStream out)
          Creates a new IO class.
 
Method Summary
static void debug(java.lang.String st)
          Static method used to print a debug statement to stdout.
static void error(java.lang.String st)
          Static method used to print an error statement to stderr.
static void error(java.lang.Throwable e)
          Static method used to print a throwable object to stderr.
protected static void log(java.lang.Object st)
          Static method used to print to the stdout.
static void warn(java.lang.String st)
          Static method used to print a warning statement to stderr.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

protected static boolean DEBUG

WARN

protected static boolean WARN

ERROR

protected static boolean ERROR

out

protected static java.io.PrintStream out
Constructor Detail

IO

public IO(boolean debug,
          boolean warning,
          boolean error)
Creates a new IO class.

Parameters:
debug - Sets the DEBUG flag to value of debug.
warning - Sets the WARN flag to value of warning.
error - Sets the ERROR flag to value of error.

IO

public IO(java.io.PrintStream out)
Creates a new IO class.

Parameters:
out - Output Stream to write to

IO

public IO(boolean debug,
          boolean warning,
          boolean error,
          java.io.PrintStream out)
Creates a new IO class.

Parameters:
debug - Sets the DEBUG flag to value of debug.
warning - Sets the WARN flag to value of warning.
error - Sets the ERROR flag to value of error.
out - Sets the output stream to write to.
Method Detail

log

protected static void log(java.lang.Object st)
Static method used to print to the stdout.


debug

public static void debug(java.lang.String st)
Static method used to print a debug statement to stdout.


warn

public static void warn(java.lang.String st)
Static method used to print a warning statement to stderr.


error

public static void error(java.lang.String st)
Static method used to print an error statement to stderr.


error

public static void error(java.lang.Throwable e)
Static method used to print a throwable object to stderr.