|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sleepycat.je.utilint.Stat<T>
public abstract class Stat<T>
Base class for all JE statistics. A single Stat embodies a value and definition. See StatGroup for a description of how to create and display statistics. Note that Stat intentionally does not contain the statistics value itself. Instead, the concrete subclass will implement the value as the appropriate primitive type. That's done to avoid wrapper classes like Integer and Long, and to keep the overhead of statistics low.
Field Summary | |
---|---|
protected StatDefinition |
definition
|
static DecimalFormat |
FORMAT
|
Constructor Summary | |
---|---|
Stat(StatGroup group,
StatDefinition definition)
A stat registers itself with an owning group. |
Method Summary | |
---|---|
abstract void |
add(Stat<T> other)
Add the value of "other" to this stat. |
abstract void |
clear()
Initialize the stat to the proper value at startup, or reset the stat when copyAndClear() is called. |
Stat<T> |
copy()
|
Stat<T> |
copyAndClear()
Return a copy of this stat, and clear the stat's value. |
abstract T |
get()
|
StatDefinition |
getDefinition()
|
protected abstract String |
getFormattedValue()
Return a string with the stat value formatted as appropriate for its type. |
abstract boolean |
isNotSet()
Returns true if this stat is zero or null, as is appropriate for its type. |
abstract void |
set(T newValue)
Set the stat value. |
String |
toString()
|
String |
toStringVerbose()
Includes the per-stat description in the output string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final DecimalFormat FORMAT
protected final StatDefinition definition
Constructor Detail |
---|
Stat(StatGroup group, StatDefinition definition)
Method Detail |
---|
public abstract T get()
public abstract void set(T newValue)
public abstract void add(Stat<T> other)
public abstract void clear()
public Stat<T> copy()
public Stat<T> copyAndClear()
public StatDefinition getDefinition()
protected abstract String getFormattedValue()
public String toString()
toString
in class Object
public String toStringVerbose()
public abstract boolean isNotSet()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |