1
2
3
4
5
6
7
8
9
10
11
12public
13class NoOfElements<E>
14 extends Accumulate<E, Integer> {
15
16
17
18
19
20 private
21 int result;
22
23
24
25 public
26 NoOfElements()
27 {
28 result = 0;
29 }
30
31
32
33 public
34 void process(E element)
35 {
36 ++result;
37 }
38
39
40
41 public
42 Integer getResult()
43 {
44
45 return
46 result;
47 }
48}
49