|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.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.
Field Summary | |
protected long |
accrued
|
protected static java.lang.String |
ACTIVE
|
protected static java.lang.String |
AVG
|
protected static java.lang.String |
AVGACTIVE
|
protected static java.lang.String |
HITS
|
protected static java.lang.String |
MAX
|
protected static java.lang.String |
MAXACTIVE
|
protected static java.lang.String |
MILLISECONDS
|
protected static java.lang.String |
MIN
|
protected static java.lang.String |
NONE
|
protected static java.lang.String |
STANDARD_DEVIATION
|
protected static java.lang.String |
TOTAL
|
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 | |
protected static java.lang.String |
convertToString(double value)
Convert a float value to a String Sample Call: String number=AccumulateMonitor.convertToString(1234.5); // returns 1,234.5 |
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 |
protected void |
getDataThis(java.util.ArrayList rowData)
Add this Monitor's accrued value in string format to an ArrayList. |
protected java.lang.String |
getDisplayString(java.lang.String type,
java.lang.String value,
java.lang.String units)
|
void |
getHeader(java.util.ArrayList header)
Add the display header that is associated with this Monitor to the header (as an ArrayList entry). |
protected void |
getHeaderThis(java.util.ArrayList header)
|
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. |
protected void |
increaseThis(long increase)
Add the value passed to this method to the Monitor's accrued value |
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(); |
protected void |
resetThis()
Erase/wipe out any accrued statistics for this monitor |
void |
setPrimary(boolean primary)
Specify whether or not this Monitor is primary. |
void |
start()
Start gathering statistics for this Monitor. |
protected void |
startThis()
Contains any logic that this Monitor must perform when it is started |
void |
stop()
Stop gathering statistics for the Monitor. |
protected void |
stopThis()
Contains any logic that this Monitor must perform when it is stopped |
java.lang.String |
toString()
Display this Monitor as well as all Monitor's in the decorator chain as Strings |
protected java.lang.String |
toStringChild()
Display Monitor's in the Decorator chain in String format |
protected java.lang.String |
toStringThis()
Display this Monitor in String format |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected static final java.lang.String TOTAL
protected static final java.lang.String MIN
protected static final java.lang.String MAX
protected static final java.lang.String HITS
protected static final java.lang.String AVG
protected static final java.lang.String STANDARD_DEVIATION
protected static final java.lang.String ACTIVE
protected static final java.lang.String AVGACTIVE
protected static final java.lang.String MAXACTIVE
protected long accrued
protected static final java.lang.String MILLISECONDS
protected static final java.lang.String NONE
Constructor Detail |
public AccumulateMonitor()
public AccumulateMonitor(AccumulateMonitorInterface childMonitor)
Method Detail |
public long getAccrued()
getAccrued
in interface MinimalMonitor
protected void resetThis()
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()
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
protected void startThis()
public void stop()
stop
in interface AccumulateMonitorInterface
protected void stopThis()
public java.lang.String getAccruedString()
protected void getDataThis(java.util.ArrayList rowData)
protected java.lang.String toStringThis()
protected java.lang.String toStringChild()
protected static java.lang.String convertToString(double value)
protected java.lang.String getDisplayString(java.lang.String type, java.lang.String value, java.lang.String units)
protected void increaseThis(long increase)
public void getHeader(java.util.ArrayList header)
getHeader
in interface MinimalMonitor
protected void getHeaderThis(java.util.ArrayList header)
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 |