razors
丰田广告歌曲javaCollections排序--多条件排序
java Collections 排序–多条件排序
// 告警排序
Collections.sort(domesticAirport, comparator);
// 告警排序
Comparator<AirportRtWeatherWarningBeanForTable> comparator = new Comparator<AirportRtWeatherWarningBeanForTable>() { @Override
public int compare(AirportRtWeatherWarningBeanForTable a1, AirportRtWeatherWarningBeanForTable a2) {
故弄玄虚英语
// ⾸先根据是否过期排序
if(a1.isMetarExpired() && !a2.isMetarExpired()){
return1;
dom
cucurbit}el if (!a1.isMetarExpired() && a2.isMetarExpired()) {
return -1;
} el if ((a1.isMetarExpired() && a2.isMetarExpired()) || (!a1.isMetarExpired() && !a2.isMetarExpired())) {
//同时过期,或者都不过期,则按告警类型排序
if (a1.getWarningColor() != a2.getWarningColor()) {
return WarningColor(), a2.getWarningColor());
benighted
}
}
//告警类型相同,按字母排序
Code4().Code4());
}
};
moderate// 告警类型⽐较排序
public int compareColor(Color color1, Color color2) {
int i = 0;
int j = 0;
if (color1.equals(MeteoWeatherWarningPanel.RED)) {
i = 3;
} el if (color1.equals(MeteoWeatherWarningPanel.YELLOW)) {
i = 2;
} el if (color1.equals(MeteoWeatherWarningPanel.GREEN)) {
i = 1;
}
if (color2.equals(MeteoWeatherWarningPanel.RED)) {
j = 3;初中英语被动语态
} el if (color2.equals(MeteoWeatherWarningPanel.YELLOW)) {
j = 2;
} el if (color2.equals(MeteoWeatherWarningPanel.GREEN)) {
j = 1;
}
int k = i - j;
if (k > 0) {
return -1;
厦门万达广场
} el if (k < 0) {
乌克兰留学费用return1;
} el
return0;
}