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