net.spy.stat
Class Stats

java.lang.Object
  extended by net.spy.SpyObject
      extended by net.spy.stat.Stats

public class Stats
extends SpyObject

Holder of the stats.


Constructor Summary
protected Stats()
           
 
Method Summary
static ComputingStat getComputingStat(String name)
          Get a computing stat by name (convenience).
static CounterStat getCounterStat(String name)
          Get a counter stat by name (convenience).
static Stats getInstance()
          Get the singleton Stats instance.
static Stat getStat(String name)
          Get the stat with the given name.
static Stat getStat(String name, Class<? extends Stat> kind)
          Get a stat by name.
 Map<String,Stat> getStats()
          Get all known stats.
static void setInstance(Stats to)
          Set the singleton stats instance.
 
Methods inherited from class net.spy.SpyObject
getLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Stats

protected Stats()
Method Detail

getInstance

public static Stats getInstance()
Get the singleton Stats instance.


setInstance

public static void setInstance(Stats to)
Set the singleton stats instance.


getStat

public static Stat getStat(String name,
                           Class<? extends Stat> kind)
Get a stat by name.

Parameters:
name - the name of the stat
kind - the kind of stat object to get
Returns:
the stat instance

getCounterStat

public static CounterStat getCounterStat(String name)
Get a counter stat by name (convenience).

Parameters:
name - name of the stat
Returns:
the stat

getComputingStat

public static ComputingStat getComputingStat(String name)
Get a computing stat by name (convenience).

Parameters:
name - name of the stat
Returns:
the stat

getStat

public static Stat getStat(String name)
Get the stat with the given name.

Parameters:
name - the name of the stat
Returns:
the Stat, or null if there's no stat with that name

getStats

public Map<String,Stat> getStats()
Get all known stats.



Copyright © 1995-2007 SPY Internetworking. All Rights Reserved.