statesystem : Add a default compareTo() for segments
[deliverable/tracecompass.git] / statesystem / org.eclipse.tracecompass.segmentstore.core / src / org / eclipse / tracecompass / segmentstore / core / BasicSegment.java
index 61b12b9997aaa4470c149798f49b356a706554d3..b1e686904390e4d8f922c3cdbce9590d94fcb01d 100644 (file)
@@ -9,14 +9,6 @@
 
 package org.eclipse.tracecompass.segmentstore.core;
 
-import static org.eclipse.tracecompass.common.core.NonNullUtils.checkNotNull;
-
-import java.util.Comparator;
-
-import org.eclipse.jdt.annotation.Nullable;
-
-import com.google.common.collect.Ordering;
-
 /**
  * Basic implementation of {@link ISegment}.
  *
@@ -26,16 +18,6 @@ public class BasicSegment implements ISegment {
 
     private static final long serialVersionUID = -3257452887960883177L;
 
-    private static final Comparator<ISegment> COMPARATOR;
-    static {
-        /* checkNotNull() has to be called separately, or else it breaks the
-         * type inference. */
-        Comparator<ISegment> comp = Ordering
-                .from(SegmentComparators.INTERVAL_START_COMPARATOR)
-                .compound(SegmentComparators.INTERVAL_END_COMPARATOR);
-        COMPARATOR = checkNotNull(comp);
-    }
-
     private final long fStart;
     private final long fEnd;
 
@@ -67,14 +49,6 @@ public class BasicSegment implements ISegment {
         return fEnd;
     }
 
-    @Override
-    public int compareTo(@Nullable ISegment o) {
-        if (o == null) {
-            throw new IllegalArgumentException();
-        }
-        return COMPARATOR.compare(this, o);
-    }
-
     @Override
     public String toString() {
         return new String('[' + String.valueOf(fStart) + ", " + String.valueOf(fEnd) + ']'); //$NON-NLS-1$
This page took 0.024624 seconds and 5 git commands to generate.