public final class Stats extends Object
NOTE: This object is thread safe.
Constructor and Description |
---|
Stats()
Constructs the object.
|
Modifier and Type | Method and Description |
---|---|
void |
add(int value,
String stat_name)
Adds the given value to a stat property.
|
void |
decrement(String stat_name)
Decrements a stat property.
|
Object |
get(String stat_name)
Retrieves the current Object value of a stat property.
|
void |
increment(String stat_name)
Increments a stat property.
|
String[] |
keyList()
Return a String array of all stat keys sorted in order from lowest to
highest.
|
void |
printTo(PrintStream out)
Outputs the stats to a print stream.
|
void |
resetSession()
Resets all stats that start with "{session}" to 0.
|
void |
set(int value,
String stat_name)
Sets the given stat name with the given value.
|
String |
statString(String key)
Returns a String representation of the stat with the given key name.
|
String |
toString()
Returns a String that can be use to print out the values of all the stats.
|
public void resetSession()
public void add(int value, String stat_name)
public void increment(String stat_name)
public void decrement(String stat_name)
public Object get(String stat_name)
public void set(int value, String stat_name)
public String[] keyList()
public String statString(String key)
public String toString()
public void printTo(PrintStream out)
Copyright © 2015. All rights reserved.