Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bradNASA authored and dandelany committed Mar 29, 2024
1 parent aabdc0a commit 1cd8714
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ public static <V> Segment<V> of(final Interval interval, final V value) {
return new Segment<>(interval, value);
}

//private Comparator<Segment<V>> comparator = Comparator.comparing(Segment<V>::interval).thenComparing(Segment::value, ObjectComparator.getInstance());
@Override
public int compareTo(final Segment<V> o) {
final var comparator =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -636,11 +636,6 @@ public Windows select(final List<Interval> intervals) {
return new Windows(segments.select(intervals));
}

// /** Delegated to {@link IntervalMap#get(int)} */
// public Segment<Boolean> get(final int index) {
// return segments.get(index);
// }

/** Delegated to {@link IntervalMap#size()} */
public int size() {
return segments.size();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@
import java.util.Set;
import java.util.SortedSet;

/**
* A generic comparator to use when you don't have one and need one. This handles some common Collection types.
* There may be some others out there that could simplify or improve on this.
*/
public class ObjectComparator implements Comparator<Object> {
private static gov.nasa.jpl.aerie.merlin.protocol.types.ObjectComparator INSTANCE = null;

Expand Down Expand Up @@ -56,6 +60,7 @@ public int compare(Object o1, Object o2) {
int c = compare(((Map.Entry<?, ?>) o1).getKey(), ((Map.Entry<?, ?>) o2).getKey());
if (c != 0) return c;
c = compare(((Map.Entry<?, ?>) o1).getValue(), ((Map.Entry<?, ?>) o2).getValue());
return c;
}

// Fallback comparison
Expand Down

0 comments on commit 1cd8714

Please sign in to comment.