// para ordenar pelo maior tempo
setMemory = new TreeSet(new Comparator() {
public int compare(Object o1, Object o2) {
JBPMemoryCount s1 = (JBPMemoryCount) o1;
JBPGenericCount s2 = (JBPGenericCount) o2;
int x = s2.getCount() - s1.getCount();
if (x != 0) {
return x;
} else if (((JBPClass) s1.getReferencedObject()).getName() != null
&& ((JBPClass) s2.getReferencedObject()).getName() != null) {
return ((JBPClass) s1.getReferencedObject()).getName()
.compareTo(
((JBPClass) s2.getReferencedObject())
.getName());
} else {
return ((JBPClass) s1.getReferencedObject()).getClassID()
- ((JBPClass) s2.getReferencedObject())
.getClassID();
}
}
});