|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.jamonapi.AccumulateMonitor
AccumulateMonitors represent Monitors that increase in value. AccumulateMonitors use the Gang of 4's decorator pattern to pass method invocations to the next Monitor in the chain. Note many of the public methods such as start(), stop() and reset() call the same method of next Monitor in the decorator chain. Any classes that inherit from AccumulateMonitor implement the protected methods startThis(), stopThis(), and resetThis() and leave the public methods as is. In general the various ...This() (startThis(), stopThis(), resetThis()) methods perform the action on that instance and the methods without ...This() (start(), stop(), reset()) take care of passing the command down the decorator chain.
Constructor Summary | |
AccumulateMonitor()
Default constructor. |
|
AccumulateMonitor(AccumulateMonitorInterface childMonitor)
Monitors use the Gang of 4 decorator pattern where each monitor points to and calls the next monitor in the chain. |
Method Summary | |
long |
getAccrued()
Get the value of the monitor. |
java.lang.String |
getAccruedString()
Return the accrued value in String format |
void |
getData(java.util.ArrayList rowData)
Populate the ArrayList with data from this Monitor as well as all other Monitors in the decorator chain |
void |
getHeader(java.util.ArrayList header)
Add the display header that is associated with this Monitor to the header (as an ArrayList entry). |
java.lang.String |
getType()
Display this Monitors type |
java.lang.String |
getUnits()
Dispay the units appropriate for this monitor |
void |
increase()
Increase the monitors accrued value by 1 unit. |
void |
increase(long increaseValue)
Increase the monitors accrued value by the ammount specified in the parameter, and call increase on all monitors in the decorator chain. |
boolean |
isPrimary()
Indicates whether or not this Monitor is primary. |
static void |
main(java.lang.String[] args)
Method that calls test code for this class. |
void |
reset()
Erase/wipe out any accrued statistics for this monitor, and call reset on all monitors in the decorator chain Sample Call: monitor.reset(); |
void |
setPrimary(boolean primary)
Specify whether or not this Monitor is primary. |
void |
start()
Start gathering statistics for this Monitor. |
void |
stop()
Stop gathering statistics for the Monitor. |
java.lang.String |
toString()
Display this Monitor as well as all Monitor's in the decorator chain as Strings |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public AccumulateMonitor()
public AccumulateMonitor(AccumulateMonitorInterface childMonitor)
Method Detail |
public long getAccrued()
getAccrued
in interface MinimalMonitor
public void increase(long increaseValue)
increase
in interface MinimalMonitor
public void increase()
increase
in interface AccumulateMonitorInterface
public void reset()
reset
in interface MinimalMonitor
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getUnits()
public java.lang.String getType()
public void getData(java.util.ArrayList rowData)
getData
in interface MinimalMonitor
public void start()
start
in interface AccumulateMonitorInterface
public void stop()
stop
in interface AccumulateMonitorInterface
public java.lang.String getAccruedString()
public void getHeader(java.util.ArrayList header)
getHeader
in interface MinimalMonitor
public boolean isPrimary()
isPrimary
in interface AccumulateMonitorInterface
public void setPrimary(boolean primary)
setPrimary
in interface AccumulateMonitorInterface
public static void main(java.lang.String[] args) throws java.lang.Exception
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |