1
2
3
4
5
6
7
8
9
10
11 package org.mule.util.counters.impl;
12
13 import org.mule.util.counters.CounterFactory.Type;
14
15 public class Number extends AbstractCounter
16 {
17
18 private double value = 0.0;
19
20 public Number(String name)
21 {
22 super(name, Type.NUMBER);
23 }
24
25 public synchronized double increment()
26 {
27 this.value++;
28 propagate();
29 return this.value;
30 }
31
32 public synchronized double incrementBy(double value)
33 {
34 this.value += value;
35 propagate();
36 return this.value;
37 }
38
39 public synchronized double decrement()
40 {
41 this.value--;
42 propagate();
43 return this.value;
44 }
45
46 public synchronized void setRawValue(double value)
47 {
48 this.value = value;
49 propagate();
50 }
51
52 public synchronized double nextValue()
53 {
54 return this.value;
55 }
56
57 }