01: package com.jamonapi;
02:
03: import java.util.*;
04:
05: /** Null implementation of the AccumulateMonitorInterface. Null objects are discussed in Martin Fowler's refactoring book.
06: * The NullAccumulateMonitor is a singleton (Gang of 4 pattern) and is used when the MonitorFactory is disabled. So when
07: * the MonitorFactory is disabled resource usage is very low and performance is very fast.
08: *
09: * All methods have empty/do nothing implementations.
10: **/
11:
12: public class NullAccumulateMonitor implements
13: AccumulateMonitorInterface {
14: NullAccumulateMonitor() {
15: }
16:
17: private static NullAccumulateMonitor nullMon = new NullAccumulateMonitor();
18:
19: public static AccumulateMonitorInterface createInstance() {
20: return nullMon;
21: }
22:
23: public void start() {
24: }
25:
26: public void stop() {
27: }
28:
29: public long getAccrued() {
30: return 0;
31: }
32:
33: public void increase(long increaseValue) {
34: }
35:
36: public void increase() {
37: }
38:
39: public void reset() {
40: }
41:
42: public void getData(ArrayList rowData) {
43: }
44:
45: public void getHeader(ArrayList header) {
46: }
47:
48: public String toString() {
49: return "";
50: }
51:
52: public boolean isPrimary() {
53: return false;
54: }
55:
56: public void setPrimary(boolean primary) {
57: }
58: }
|