|
IDebug © 1997-2001 Joseph Kiniry © 2000-2001 KindSoftware © 1997-1999 Caltech All Rights Reserved |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--idebug.Collect
The core interface to gathering statistics.
Users of IDebug wishing to keep statistics on their system need to
inherit from this abstract class and implement the protected methods.
The simplest means to collect statistics are to use a hashtable keyed on
statistic (since their hashCode is valid) and store Double objects
corresponding to the current value of that statistic. See
idebug.SimpleCollect for an example of this
implementation which you can reuse.
Statistic,
SimpleCollect| Constructor Summary | |
Collect()
Construct a new Collect class. |
|
| Method Summary | |
boolean |
checkDebugCollectRef(Debug d)
Checks a debug instance to make sure its collect
attribute references this Collect object. |
boolean |
checkStatisticID(Statistic statistic)
Check the ID of a statistic and make sure that it hasn't changed since it was registered. |
abstract double |
currentValue(Statistic statistic)
What is the current value for specific statistic? |
abstract double |
decrement(Statistic statistic)
Decrement a statistic by the default value. |
abstract double |
decrement(Statistic statistic,
double value)
Decrement a statistic by a specified value. |
abstract double |
increment(Statistic statistic)
Increment a statistic by the default value. |
abstract double |
increment(Statistic statistic,
double value)
Increment a statistic by a specified value. |
boolean |
isRegistered(Statistic statistic)
Check to see if a statistic is registered yet. |
protected boolean |
isValidCategory(java.lang.String category)
Tests to see if the current debug context is interested in a given category. |
protected boolean |
isValidLevel(int level)
Tests to see if the current debug context is interested in a given level. |
void |
register(Statistic statistic)
Register a statistic with the collector. |
abstract java.lang.Object |
report(Statistic statistic)
Report on a particular statistic. |
abstract java.lang.Object |
reportAll()
Report on all statistics. |
abstract double |
reset(Statistic statistic)
Reset a statistic to the default start value. |
abstract double |
set(Statistic statistic,
double value)
Set a statistic to a specific value. |
void |
setDebug(Debug d)
Set the debug instance associated with this collect instance. |
void |
unregister(Statistic statistic)
Unregister a statistic with the collector. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Collect()
Construct a new Collect class.
| Method Detail |
public boolean checkDebugCollectRef(Debug d)
Checks a debug instance to make sure its collect
attribute references this Collect object.
d - the debug instance to check.public final void setDebug(Debug d)
Set the debug instance associated with this collect instance.
This method must be called with the correct debug
instance prior to using any of the methods of this
Collect instance.
d - the debug object associated with this Collect
object.public void register(Statistic statistic)
Register a statistic with the collector.
statistic - the statistic to register.public boolean checkStatisticID(Statistic statistic)
Check the ID of a statistic and make sure that it hasn't changed since it was registered.
statistic - the statistic to check.public void unregister(Statistic statistic)
Unregister a statistic with the collector.
statistic - the statistic to unregister.public boolean isRegistered(Statistic statistic)
Check to see if a statistic is registered yet.
statistic - the statistic to check.public abstract double currentValue(Statistic statistic)
What is the current value for specific statistic?
statistic - the statistic being modified.public abstract java.lang.Object report(Statistic statistic)
Report on a particular statistic.
statistic - the statistic being reported on.Report object or just a simple String
textual report.public abstract java.lang.Object reportAll()
Report on all statistics.
public abstract double increment(Statistic statistic,
double value)
Increment a statistic by a specified value.
statistic - the statistic being modified.value - the amount to increment the statistic.public abstract double increment(Statistic statistic)
Increment a statistic by the default value.
statistic - the statistic being modified.
public abstract double decrement(Statistic statistic,
double value)
Decrement a statistic by a specified value.
statistic - the statistic being modified.value - the amount to decrement the statistic.public abstract double decrement(Statistic statistic)
Decrement a statistic by the default value.
statistic - the statistic being modified.public abstract double reset(Statistic statistic)
Reset a statistic to the default start value.
statistic - the statistic to reset.
public abstract double set(Statistic statistic,
double value)
Set a statistic to a specific value.
statistic - the statistic being modified.value - the new value of the statistic.protected final boolean isValidCategory(java.lang.String category)
Tests to see if the current debug context is interested in a given category.
category - the category to inspect.Contextprotected final boolean isValidLevel(int level)
Tests to see if the current debug context is interested in a given level.
level - the level to inspect.Context
|
IDebug © 1997-2001 Joseph Kiniry © 2000-2001 KindSoftware © 1997-1999 Caltech All Rights Reserved |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||