com.speckled.specksim.statistics
Class StatisticsGatherer

java.lang.Object
  extended by com.speckled.specksim.statistics.StatisticsGatherer

public class StatisticsGatherer
extends java.lang.Object

A StatisticsGatherer has a set of modules that do the actual statistics generation.

Author:
ryanm

Constructor Summary
StatisticsGatherer(StateSink state)
          Constructs a new StatisticsGatherer that will update on changes to the supplied state
 
Method Summary
 int getHistoryLength()
          Gets the length of this gatherer's history
 StatisticsModule getModule(java.lang.String name)
          Gets a named module
 java.lang.String[] getModuleNames()
          Gets an array of the names of all the modules in this gatherer
static boolean register(java.lang.String className)
          Use this method in your startup code to make a statistics module available.
 void setHistoryLength(int history)
          Sets the length of this gatherer's history
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatisticsGatherer

public StatisticsGatherer(StateSink state)
Constructs a new StatisticsGatherer that will update on changes to the supplied state

Parameters:
state - The state on which to operate
Method Detail

getModuleNames

public java.lang.String[] getModuleNames()
Gets an array of the names of all the modules in this gatherer

Returns:
An array of Strings

getModule

public StatisticsModule getModule(java.lang.String name)
Gets a named module

Parameters:
name - the anme of the desired module
Returns:
The module, or null if no such module exists

setHistoryLength

public void setHistoryLength(int history)
Sets the length of this gatherer's history

Parameters:
history - The desired length of history

getHistoryLength

public int getHistoryLength()
Gets the length of this gatherer's history

Returns:
The number of past values that are saved in the history

register

public static boolean register(java.lang.String className)
Use this method in your startup code to make a statistics module available. Should be called before a gatherer is constructed, or the module will not be included.

Parameters:
className - The classname of the module to register
Returns:
true if the module was succesfully registered, flas otherwise