Created
January 16, 2012 06:32
-
-
Save dmitrygusev/1619412 to your computer and use it in GitHub Desktop.
For blog comment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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