Skip to content

Instantly share code, notes, and snippets.

@dmitrygusev
Created January 16, 2012 06:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dmitrygusev/1619412 to your computer and use it in GitHub Desktop.
Save dmitrygusev/1619412 to your computer and use it in GitHub Desktop.
For blog comment
private Map<String, List<String>> traces = new HashMap<String, List<String>>();
private void writeSummary(final List<String> headers) throws IOException {
SortHandler<Integer> handler = new SortHandler<Integer>() {
public int to() {
return headers.size() - 1;
}
public void swap(int i, int j) {
Collections.swap(headers, i, j);
}
public Integer get(int index) {
String header = headers.get(index);
return traces.get(headerKeys.get(header)).size();
}
public int compare(Integer a, Integer b) {
return a.compareTo(b);
}
};
handler.sort();
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment