|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.mckoi.util.Stats
public final class Stats
An object that is used to store and update various stats.
NOTE: This object is thread safe.
Constructor Summary | |
---|---|
Stats()
Constructs the object. |
Method Summary | |
---|---|
void |
add(int value,
java.lang.String stat_name)
Adds the given value to a stat property. |
void |
decrement(java.lang.String stat_name)
Decrements a stat property. |
java.lang.Object |
get(java.lang.String stat_name)
Retrieves the current Object value of a stat property. |
void |
increment(java.lang.String stat_name)
Increments a stat property. |
java.lang.String[] |
keyList()
Return a String array of all stat keys sorted in order from lowest to highest. |
void |
printTo(java.io.PrintStream out)
Outputs the stats to a print stream. |
void |
resetSession()
Resets all stats that start with "{session}" to 0. |
void |
set(int value,
java.lang.String stat_name)
Sets the given stat name with the given value. |
java.lang.String |
statString(java.lang.String key)
Returns a String representation of the stat with the given key name. |
java.lang.String |
toString()
Returns a String that can be use to print out the values of all the stats. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Stats()
Method Detail |
---|
public void resetSession()
public void add(int value, java.lang.String stat_name)
public void increment(java.lang.String stat_name)
public void decrement(java.lang.String stat_name)
public java.lang.Object get(java.lang.String stat_name)
public void set(int value, java.lang.String stat_name)
public java.lang.String[] keyList()
public java.lang.String statString(java.lang.String key)
public java.lang.String toString()
toString
in class java.lang.Object
public void printTo(java.io.PrintStream out)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |