apollo.Statistics
Class Statistic

java.lang.Object
  |
  +--apollo.Statistics.Statistic
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
DummyStat, GZIPStat, ServletStat, StatsManager, UserExceptionStat

public abstract class Statistic
extends java.lang.Object
implements java.io.Serializable

This is the abstract class for a Statistic. Copyright Joe Kislo, All Rights Reserved.

See Also:
Serialized Form

Field Summary
protected  java.util.Hashtable registeredStats
           
protected  java.util.Hashtable statsMethodRegistry
           
 
Constructor Summary
Statistic()
           
 
Method Summary
 void addStat(java.lang.String UID, java.lang.Object o)
          Adds the Object to the Stat.
 void bindMethodToStat(java.lang.String UID, ExecutableMethod executableMethod)
          Registered a method to be called when this UID is updated
protected  void callStatMethod(java.lang.String UID, java.lang.Object existingObject, java.lang.Object newObject)
           
 void clearMethodRegistry()
           
 void clearStats()
          Clears the list of registered Stats
 ExecutableMethod getMethodRegistry(java.lang.String UID)
           
 java.lang.Object getObject(java.lang.String UID)
          Returns the Object assosciated with UID
 Statistic getStat(java.lang.String UID)
          Returns the Statistic assosciated with UID
 java.util.Enumeration getStats()
           
 void incStat(java.lang.String UID)
           
 void incStat(java.lang.String UID, float f)
           
 void incStat(java.lang.String UID, int i)
           
 void registerStat(java.lang.String UID, float Stat)
           
 void registerStat(java.lang.String UID, int Stat)
           
 void registerStat(java.lang.String UID, java.lang.Object Stat)
          Registers a Stat the UID it will respond to.
 void registerStat(java.lang.String UID, Statistic Stat)
           
 java.lang.String renderToHTML()
          Render this Statistic in HTML.
 void unbindMethodToStat(java.lang.String UID)
           
 void unregisterUID(java.lang.String UID)
          Unregisters the Stat assosciated with a particular UID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

registeredStats

protected java.util.Hashtable registeredStats

statsMethodRegistry

protected java.util.Hashtable statsMethodRegistry
Constructor Detail

Statistic

public Statistic()
Method Detail

registerStat

public void registerStat(java.lang.String UID,
                         java.lang.Object Stat)
Registers a Stat the UID it will respond to.
Parameters:
UID - The UID it will respond to
Stat - The Stat to be registered

registerStat

public void registerStat(java.lang.String UID,
                         Statistic Stat)

registerStat

public void registerStat(java.lang.String UID,
                         int Stat)

registerStat

public void registerStat(java.lang.String UID,
                         float Stat)

bindMethodToStat

public void bindMethodToStat(java.lang.String UID,
                             ExecutableMethod executableMethod)
Registered a method to be called when this UID is updated
Parameters:
UID - The UID to bind this method to
executableMethod - The object which implements ExecutableMethod

unbindMethodToStat

public void unbindMethodToStat(java.lang.String UID)

clearMethodRegistry

public void clearMethodRegistry()

getMethodRegistry

public ExecutableMethod getMethodRegistry(java.lang.String UID)

unregisterUID

public void unregisterUID(java.lang.String UID)
Unregisters the Stat assosciated with a particular UID
Parameters:
UID - The UID for the stat

getStat

public Statistic getStat(java.lang.String UID)
Returns the Statistic assosciated with UID
Parameters:
UID - The Unique ID

getObject

public java.lang.Object getObject(java.lang.String UID)
Returns the Object assosciated with UID
Parameters:
UID - The Unique ID

clearStats

public void clearStats()
Clears the list of registered Stats

incStat

public void incStat(java.lang.String UID)

incStat

public void incStat(java.lang.String UID,
                    int i)

incStat

public void incStat(java.lang.String UID,
                    float f)

addStat

public void addStat(java.lang.String UID,
                    java.lang.Object o)
Adds the Object to the Stat. Assumes the Stat is a vector
Parameters:
UID - The UID
o - The object to be added to the vector

callStatMethod

protected void callStatMethod(java.lang.String UID,
                              java.lang.Object existingObject,
                              java.lang.Object newObject)

getStats

public java.util.Enumeration getStats()

renderToHTML

public java.lang.String renderToHTML()
                              throws TemplatePageException
Render this Statistic in HTML. *NORMALLY* you would want to override this method and render this stuff yourself.