ss: Implement ISegment#getLength() as a default method
[deliverable/tracecompass.git] / statesystem / org.eclipse.tracecompass.segmentstore.core / src / org / eclipse / tracecompass / segmentstore / core / ISegment.java
index 8b21c4c14fc7c0da0d87d4e1d6c90ab0f2f11de8..e82cf387d8322b42e11f469a546f82695f536627 100644 (file)
@@ -37,10 +37,11 @@ public interface ISegment extends Serializable, Comparable<ISegment> {
     long getEnd();
 
     /**
-     * The length/duration of the segment. Normally ({@link #getEnd()} -
-     * {@link #getStart()}).
+     * The length/duration of the segment.
      *
      * @return The duration
      */
-    long getLength();
+    default long getLength() {
+        return getEnd() - getStart();
+    }
 }
This page took 0.031539 seconds and 5 git commands to generate.