I have a sample class, say Country
:
class Country {
public String name;
public int population;
public Flag flag;
...
}
I have this Flag
class defined somewhere else
class Flag {
String id;
int pixel;
...
}
Now I create a separate comparator DefaultFlagRankingComparator() that can sort Flag by id. How can I sort a list of Country by Flag id, using this DefaultFlagRankingComparator()?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…