public final class Debug
extends java.lang.Object
import cz.fzu.metlov.jel.*; ..... BLA BLA BLA ... if (Debug.enabled) { Debug.println("I want this message to disappear in the optimized version"); Debug.check(foo==superTimeConsumingFunction(bar), "I do not want to evaluate superTimeConsumingFunction(), when optimized."); };
Modifier and Type | Field and Description |
---|---|
static boolean |
enabled
Determines if debugging is enabled in current compilation.
|
Constructor and Description |
---|
Debug() |
Modifier and Type | Method and Description |
---|---|
static void |
check(boolean condition)
Checks for the condition.
|
static void |
check(boolean condition,
java.lang.String message)
Checks for the condition.
|
static void |
println(java.lang.String message)
Prints a line of the debug output.
|
static void |
reportThrowable(java.lang.Throwable t)
Reports an exception, which should not occur(i.e.
|
static void |
reportThrowable(java.lang.Throwable t,
java.lang.String message)
Reports an exception, which should not occur(i.e.
|
public static final boolean enabled
public static final void println(java.lang.String message)
message
- message to print.public static final void check(boolean condition, java.lang.String message)
condition
- is the condition to check.message
- is the message to print if condition is false.public static final void check(boolean condition)
condition
- is the condition to check.public static final void reportThrowable(java.lang.Throwable t, java.lang.String message)
t
- is what was thrown.message
- is algorithm specific message.public static final void reportThrowable(java.lang.Throwable t)
t
- is what was thrown.Copyright © 1998-2017 Konstantin L. Metlov All Rights Reserved.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the JEL manual.