|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--mascoptLib.util.Trace
This class provides an elegant way of trace your programs.
The trace print some message on output. You can activate or unactivate the trace such that you can leave your traces in the program.
The trace provides a level system: you can display the messages converning one level. You can see the level already define in the parameter section of this class.
Field Summary | |
static int |
ALL
Trace Level 0 |
static int |
ERROR
Trace Level 1 |
static int |
MEMORY
Trace Level 2 |
Constructor Summary | |
Trace()
|
Method Summary | |
static void |
finalizeObj(String id)
Finalize an object referenced by an id. |
static long |
getTime(int ref)
Returns the time in ms from the last start of this timer |
static void |
newObj(String id)
Add an object with an id in object Alive references. |
static void |
print(String s)
Print a string on the Trace. |
static void |
print(String s,
int level)
Print a string on the Trace. |
static void |
printErr(String s)
Print a string on the Error Trace. |
static void |
printErrln(String s)
Print a string on the Error Trace. |
static void |
println(String s)
Print a string on the Trace. |
static void |
println(String s,
int level)
Print a string on the Trace. |
static void |
printObjectsAlive()
Prints all object alive. |
static void |
setNameObj(String id,
String name)
Change the name of the object referenced by an id. |
static void |
setVisible(boolean b)
Switch the trace mode. |
static void |
setVisible(boolean b,
int level)
Switch the trace mode for a level only. |
static void |
setVisibleErr(boolean b)
Switch the trace mode for errors. |
static void |
startTime(int ref)
Start a time count. 10 timers can be launched. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static int ALL
public static int ERROR
public static int MEMORY
Constructor Detail |
public Trace()
Method Detail |
public static void setVisible(boolean b)
b
- indicate the Trace modepublic static void setVisible(boolean b, int level)
level
- the level to switch.b
- indicate the Trace mode.public static void setVisibleErr(boolean b)
b
- indicate the Trace error modepublic static void print(String s)
s
- the string to printpublic static void println(String s)
s
- the string to printpublic static void print(String s, int level)
s
- the string to printpublic static void println(String s, int level)
s
- the string to printpublic static void printErr(String s)
s
- the string to printpublic static void printErrln(String s)
s
- the string to printpublic static void startTime(int ref)
ref
- the timer numberpublic static long getTime(int ref)
ref
- the timer number
public static void newObj(String id)
id
- the id of the object.public static void setNameObj(String id, String name)
id
- the id of the object.name
- its name.public static void finalizeObj(String id)
id
- the id object.public static void printObjectsAlive()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |