public SortedRecorder(boolean reverse) {
this.reverse = reverse;
}
public void addDependency(Dependency d) {
Location o = (reverse ? d.getTarget() : d.getOrigin());
SortedSet<Dependency> odeps = map.get(o);
if (odeps == null) {
Comparator<Dependency> c = (reverse ? originComparator : targetComparator);
map.put(o, odeps = new TreeSet<Dependency>(c));
}