1
2
3
4
5 package net.sf.openv4j;
6
7 import java.util.Comparator;
8
9
10
11
12
13
14 public class GroupAndNameComparator implements Comparator<DataPoint> {
15
16
17
18 public GroupAndNameComparator() {
19 }
20
21
22
23
24
25
26
27
28
29 @Override
30 public int compare(DataPoint o1, DataPoint o2) {
31 int result = o1.getGroup().compareTo(o2.getGroup());
32
33 if (result != 0) {
34 return result;
35 }
36
37 result = o1.getValueKind().compareTo(o2.getValueKind());
38
39 if (result != 0) {
40 return result;
41 }
42
43 result = o1.getValue().compareTo(o2.getValue());
44
45 return result;
46 }
47 }