Skip to content

Instantly share code, notes, and snippets.

Created November 24, 2012 12:16
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save anonymous/4139439 to your computer and use it in GitHub Desktop.
Comparison Violation
private void sortArrayList(ArrayList v) {
Collections.sort(v, new Comparator() {
public int compare(Object o1, Object o2) {
return (int) (((InvPair) o1).getCurr() - ((InvPair) o2).getCurr());
}
});
Collections.sort(v, new Comparator() {
public int compare(Object o1, Object o2) {
return (int) (((InvPair) o1).getLast() - ((InvPair) o2).getLast());
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment