GDTempTownIndex t = (GDTempTownIndex) result.get(i);
try {
// System.out.println("t.name="+t.getTownName());
// System.out.println("t.ms="+ms.getName());
System.out.println("t.value=" + ms.invoke(t));
if (ms.invoke(t) == null) {
addList.add(t);
}
} catch (Exception ex) {
ex.printStackTrace();
}
}
result.removeAll(addList);
System.out.println("==result.size()=" + result.size());
System.out.println("addList.size()=" + addList.size());
Comparator comp = new Comparator() {
@Override
public int compare(Object o1, Object o2) {
GDTempTownIndex p1 = (GDTempTownIndex) o1;
GDTempTownIndex p2 = (GDTempTownIndex) o2;
int i = -1;
try {
if ((Double) ms.invoke(p1) <((Double) ms.invoke(p2))) {
i &#61; 1;
} else if ((Double) ms.invoke(p1) > ((Double) ms.invoke(p2))) {
i &#61; -1;
}
} catch (Exception ex) {
ex.printStackTrace();
} finally {
return i;
}
}
};
//排序
System.out.println("&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;&#61;is&#61;");
if (result.size() !&#61; 0) {
Collections.sort(result, comp);
}
for (int i &#61; 0; i Method m &#61; mss[i];
String name &#61; m.getName();
if (name.startsWith("set") && name.endsWith(set)) {
ms &#61; m;
}
}
//设置排名
try {
for (int i &#61; 0; i GDTempTownIndex t &#61; (GDTempTownIndex) result.get(i);
ms.invoke(t, new Double(String.valueOf(i &#43; 1)));
}
result.addAll(addList);
} catch (Exception ex) {
ex.printStackTrace();
}
}