juju.reattore.util
Class BaseStat

java.lang.Object
  |
  +--juju.reattore.util.BaseStat
All Implemented Interfaces:
Stat
Direct Known Subclasses:
CounterStat, DurationStat, GaugeStat, RateStat

public abstract class BaseStat
extends java.lang.Object
implements Stat

Base implementation of a statistic module.


Constructor Summary
BaseStat(java.lang.Class clazz, java.lang.String leaf)
          Create a new statistic for the given class and leaf name.
 
Method Summary
 java.lang.String format()
          Summarise this statistic as a string.
protected abstract  java.lang.String getDefaultFormat()
          Returns the default format string to use.
protected abstract  java.lang.Object[] getFormatArgs()
          Returns the argument list used in formatting the summary.
 java.lang.String getName()
          Returns the fully qualified name of this stat.
 void setFormat(java.lang.String fmt)
          Sets the format used in summarising this stat.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseStat

public BaseStat(java.lang.Class clazz,
                java.lang.String leaf)
Create a new statistic for the given class and leaf name.

Parameters:
clazz - The class name, used as the stat base name.
leaf - The name of the stat within this class.
Method Detail

getDefaultFormat

protected abstract java.lang.String getDefaultFormat()
Returns the default format string to use.

Returns:
The default format string.

getFormatArgs

protected abstract java.lang.Object[] getFormatArgs()
Returns the argument list used in formatting the summary.

Returns:
A list of objects for MessageFormat.

getName

public java.lang.String getName()
Returns the fully qualified name of this stat.

Specified by:
getName in interface Stat
Returns:
The fqn.

setFormat

public void setFormat(java.lang.String fmt)
Sets the format used in summarising this stat.

Specified by:
setFormat in interface Stat
Parameters:
fmt - The format in MessageFormat style.

format

public java.lang.String format()
Summarise this statistic as a string.

Specified by:
format in interface Stat
Returns:
This stat summarised according to #setFormat.


Copyright © 2002-2003 Michael Hope. All Rights Reserved.