1 | |
package org.kuali.student.lum.common.client.lo; |
2 | |
|
3 | |
import java.util.Comparator; |
4 | |
import java.util.TreeSet; |
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
public class LoDisplayInfoSortedSet extends TreeSet<LoDisplayInfoHelper> { |
10 | |
private static final long serialVersionUID = 1L; |
11 | |
|
12 | |
public LoDisplayInfoSortedSet() { |
13 | 0 | super(new Comparator<LoDisplayInfoHelper>() { |
14 | |
@Override |
15 | |
public int compare(LoDisplayInfoHelper o1, LoDisplayInfoHelper o2) { |
16 | 0 | LoInfoHelper o1InfoHelper = new LoInfoHelper(o1.getLoInfo()); |
17 | 0 | LoInfoHelper o2InfoHelper = new LoInfoHelper(o2.getLoInfo()); |
18 | 0 | int seq1 = -1; |
19 | 0 | int seq2 = -1; |
20 | |
|
21 | 0 | seq1 = (o1InfoHelper.getSequence() == null) ? |
22 | |
0 : Integer.valueOf(o1InfoHelper.getSequence()); |
23 | 0 | seq2 = (o2InfoHelper.getSequence() == null) ? |
24 | |
0 : Integer.valueOf(o2InfoHelper.getSequence()); |
25 | 0 | return Integer.valueOf(seq1).compareTo(Integer.valueOf(seq2)); |
26 | |
} |
27 | |
}); |
28 | 0 | } |
29 | |
} |