com.jamonapi
Class NullAccumulateMonitor

java.lang.Object
  |
  +--com.jamonapi.NullAccumulateMonitor
All Implemented Interfaces:
AccumulateMonitorInterface, MinimalMonitor

public class NullAccumulateMonitor
extends java.lang.Object
implements AccumulateMonitorInterface

Null implementation of the AccumulateMonitorInterface. Null objects are discussed in Martin Fowler's refactoring book. The NullAccumulateMonitor is a singleton (Gang of 4 pattern) and is used when the MonitorFactory is disabled. So when the MonitorFactory is disabled resource usage is very low and performance is very fast. All methods have empty/do nothing implementations.


Method Summary
static AccumulateMonitorInterface createInstance()
           
 long getAccrued()
          Return the accrued value.
 void getData(java.util.ArrayList rowData)
          Add this elements value to the ArrayList.
 void getHeader(java.util.ArrayList header)
          Add this elements header value to an ArrayList.
 void increase()
          increase the stored value for this Monitor
 void increase(long increaseValue)
          Increase the monitors value
 boolean isPrimary()
          indicates whether or not this Monitor is primary or not.
 void reset()
          Erase the values in the monitor
 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 this Monitor
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

createInstance

public static AccumulateMonitorInterface createInstance()

start

public void start()
Description copied from interface: AccumulateMonitorInterface
start() gathering statistics for this Monitor

Specified by:
start in interface AccumulateMonitorInterface

stop

public void stop()
Description copied from interface: AccumulateMonitorInterface
stop() gathering statistics for this Monitor

Specified by:
stop in interface AccumulateMonitorInterface

getAccrued

public long getAccrued()
Description copied from interface: MinimalMonitor
Return the accrued value. In the case of timing monitors this would be the elapsed time since the timer started

Specified by:
getAccrued in interface MinimalMonitor

increase

public void increase(long increaseValue)
Description copied from interface: MinimalMonitor
Increase the monitors value

Specified by:
increase in interface MinimalMonitor

increase

public void increase()
Description copied from interface: AccumulateMonitorInterface
increase the stored value for this Monitor

Specified by:
increase in interface AccumulateMonitorInterface

reset

public void reset()
Description copied from interface: MinimalMonitor
Erase the values in the monitor

Specified by:
reset in interface MinimalMonitor

getData

public void getData(java.util.ArrayList rowData)
Description copied from interface: MinimalMonitor
Add this elements value to the ArrayList. This is used to display the Monitor in a tabular format.

Specified by:
getData in interface MinimalMonitor

getHeader

public void getHeader(java.util.ArrayList header)
Description copied from interface: MinimalMonitor
Add this elements header value to an ArrayList. This is used to display the Monitor in a tabular format.

Specified by:
getHeader in interface MinimalMonitor

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

isPrimary

public boolean isPrimary()
Description copied from interface: AccumulateMonitorInterface
indicates whether or not this Monitor is primary or not. See www.jamonapi.com for more info

Specified by:
isPrimary in interface AccumulateMonitorInterface

setPrimary

public void setPrimary(boolean primary)
Description copied from interface: AccumulateMonitorInterface
Specify whether or not this Monitor is primary. See www.jamonapi.com for more info

Specified by:
setPrimary in interface AccumulateMonitorInterface