net.sourceforge.jFuzzyLogic
Class Gpr

java.lang.Object
  extended by net.sourceforge.jFuzzyLogic.Gpr

public class Gpr
extends java.lang.Object

General pupose rutines

Author:
Pablo Cingolani

Field Summary
static int MAX_NUMBER_OF_WARNINGS
          Only print this number of warnings
static int warnCount
          Print warning only N times
 
Constructor Summary
Gpr()
           
 
Method Summary
static void debug(boolean b)
          Prints a debug message (prints class name, method and line number)
static void debug(boolean debug, int i)
          Prits a debug message (prints class name, method and line number)
static void debug(boolean debug, java.lang.Object obj)
          Prits a debug message (prints class name, method and line number)
static void debug(double d)
          Prints a debug message (prints class name, method and line number)
static void debug(int i)
          Prints a debug message (prints class name, method and line number)
static void debug(int currentDebugLevel, int thisMessageLevel, java.lang.Object obj)
          Prits a debug message (prints class name, method and line number)
static void debug(java.lang.Object obj)
          Prits a debug message (prints class name, method and line number)
static void debug(java.lang.Object obj, int offset)
          Prits a debug message (prints class name, method and line number)
static void debug(java.lang.Object obj, int offset, boolean newLine)
          Prits a debug message (prints class name, method and line number)
static boolean parseBooleanSafe(java.lang.String s)
          Equivalent to Integer.parseInt, except it returns 0 on invalid integer (NumberFormatException)
static double parseDoubleSafe(java.lang.String s)
          Equivalent to Double.parseDouble, except it returns 0 on invalid value (NumberFormatException)
static int parseIntSafe(java.lang.String s)
          Equivalent to Integer.parseInt, except it returns 0 on invalid integer (NumberFormatException)
static void toFile(java.lang.String fileName, java.lang.Object obj)
          Write an object to a file
static void warn(java.lang.String warning)
          Print a warning message (only a few of them)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAX_NUMBER_OF_WARNINGS

public static int MAX_NUMBER_OF_WARNINGS
Only print this number of warnings


warnCount

public static int warnCount
Print warning only N times

Constructor Detail

Gpr

public Gpr()
Method Detail

debug

public static void debug(boolean b)
Prints a debug message (prints class name, method and line number)

Parameters:
b - : Boolean to print

debug

public static void debug(boolean debug,
                         int i)
Prits a debug message (prints class name, method and line number)

Parameters:
debug - : Only prints message if debug=true
i - : int to print

debug

public static void debug(boolean debug,
                         java.lang.Object obj)
Prits a debug message (prints class name, method and line number)

Parameters:
debug - : Only prints message if debug=true
obj - : Object to print

debug

public static void debug(double d)
Prints a debug message (prints class name, method and line number)

Parameters:
d - : double to print

debug

public static void debug(int i)
Prints a debug message (prints class name, method and line number)

Parameters:
i - : int to print

debug

public static void debug(int currentDebugLevel,
                         int thisMessageLevel,
                         java.lang.Object obj)
Prits a debug message (prints class name, method and line number)

Parameters:
currentDebugLevel - : Debug level being used
thisMessageLevel - : Only prints message if thisMessageLevel >= currentDebugLevel
obj - : Object to print

debug

public static void debug(java.lang.Object obj)
Prits a debug message (prints class name, method and line number)

Parameters:
obj - : Object to print

debug

public static void debug(java.lang.Object obj,
                         int offset)
Prits a debug message (prints class name, method and line number)

Parameters:
obj - : Object to print
offset - : Offset N lines from stacktrace

debug

public static void debug(java.lang.Object obj,
                         int offset,
                         boolean newLine)
Prits a debug message (prints class name, method and line number)

Parameters:
obj - : Object to print
offset - : Offset N lines from stacktrace
newLine - : Print a newline char at the end ('\n')

parseBooleanSafe

public static boolean parseBooleanSafe(java.lang.String s)
Equivalent to Integer.parseInt, except it returns 0 on invalid integer (NumberFormatException)

Parameters:
s -
Returns:
int

parseDoubleSafe

public static double parseDoubleSafe(java.lang.String s)
Equivalent to Double.parseDouble, except it returns 0 on invalid value (NumberFormatException)

Parameters:
s -
Returns:
double

parseIntSafe

public static int parseIntSafe(java.lang.String s)
Equivalent to Integer.parseInt, except it returns 0 on invalid integer (NumberFormatException)

Parameters:
s -
Returns:
int

toFile

public static void toFile(java.lang.String fileName,
                          java.lang.Object obj)
Write an object to a file

Parameters:
fileName - : File to write
obj - : Object

warn

public static void warn(java.lang.String warning)
Print a warning message (only a few of them)

Parameters:
warning -