1 package com.google.code.jetm.reporting.xml;
2
3 import java.util.Collections;
4 import java.util.Map;
5
6 import etm.core.aggregation.Aggregate;
7
8
9
10
11
12
13
14
15
16 public class XmlAggregate implements Aggregate {
17 private final double min;
18 private final double max;
19 private final double total;
20 private final long measurements;
21 private final String name;
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39 public XmlAggregate(double min, double max, double total, long measurements, String name) {
40 this.min = min;
41 this.max = max;
42 this.total = total;
43 this.name = name;
44 this.measurements = measurements;
45 }
46
47
48
49
50 public double getAverage() {
51 return measurements == 0 ? 0 : total / (double) measurements;
52 }
53
54
55
56
57 public Map<?, ?> getChilds() {
58 return Collections.emptyMap();
59 }
60
61
62
63
64 public double getMax() {
65 return max;
66 }
67
68
69
70
71 public long getMeasurements() {
72 return measurements;
73 }
74
75
76
77
78 public double getMin() {
79 return min;
80 }
81
82
83
84
85 public String getName() {
86 return name;
87 }
88
89
90
91
92 public double getTotal() {
93 return total;
94 }
95
96
97
98
99 public boolean hasChilds() {
100 return false;
101 }
102
103 }