public static void print(String str) { if (!debugOn) { return; } debug.instancePrint(str); } /*
public void instancePrint(Object obj) { if (obj instanceof Collection) { instancePrint(((Collection) obj).iterator()); } else if (obj instanceof Iterator) { instancePrint((Iterator) obj); } else { instancePrintObject(obj); } }
public static void print(Object obj) { if (! debugOn) return; debug.instancePrint(obj); }
public void instancePrint(Object obj) { if (obj instanceof Collection) { instancePrint(((Collection) obj).iterator()); } else if (obj instanceof Iterator) { instancePrint((Iterator) obj); } else { instancePrintObject(obj); } }
public void instancePrintWatch() { if (watchObj == null) return; instancePrint(watchObj); }
public static void print(boolean isTrue, Object obj) { if (! debugOn) return; if (! isTrue) return; debug.instancePrint(obj); }
public void instancePrintIfWatch(Object obj) { if (obj != watchObj) return; if (watchObj == null) return; instancePrint(watchObj); }
public static void println(Object obj) { if (!debugOn) { return; } debug.instancePrint(obj); debug.println(); }
public void instancePrintObject(Object obj) { //if (true) throw new RuntimeException("DEBUG TRAP!"); Method printMethod = null; try { Class cls = obj.getClass(); try { printMethod = cls.getMethod("print", printArgs); args[0] = out; out.print(DEBUG_LINE_TAG); printMethod.invoke(obj, args); } catch (NoSuchMethodException ex) { instancePrint(obj.toString()); } } catch (Exception ex) { ex.printStackTrace(out); } }
public static void print(boolean isTrue, Object obj) { if (! debugOn) return; if (! isTrue) return; debug.instancePrint(obj); }
public void instancePrintWatch() { if (watchObj == null) return; instancePrint(watchObj); }
public static void print(Object obj) { if (! debugOn) return; debug.instancePrint(obj); }
public static void print(String str) { if (!debugOn) { return; } debug.instancePrint(str); } /*
public void instancePrintIfWatch(Object obj) { if (obj != watchObj) return; if (watchObj == null) return; instancePrint(watchObj); }
public static void println(Object obj) { if (!debugOn) { return; } debug.instancePrint(obj); debug.println(); }
public void instancePrintObject(Object obj) { //if (true) throw new RuntimeException("DEBUG TRAP!"); Method printMethod = null; try { Class cls = obj.getClass(); try { printMethod = cls.getMethod("print", printArgs); args[0] = out; out.print(DEBUG_LINE_TAG); printMethod.invoke(obj, args); } catch (NoSuchMethodException ex) { instancePrint(obj.toString()); } } catch (Exception ex) { ex.printStackTrace(out); } }
public static void printTime(String tag) { if (!debugOn) { return; } long time = stopwatch.getTime(); long elapsedTime = time - lastTimePrinted; debug.instancePrint( formatField(Stopwatch.getTimeString(time), 10) + " (" + formatField(Stopwatch.getTimeString(elapsedTime), 10) + " ) " + tag); debug.println(); lastTimePrinted = time; }