Add handling of initial range offset in experiments
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / tmf / core / trace / TmfExperiment.java
index 2a25b96739c92daaabcca12716a9a4b6ecef095d..eda777efdddc5331e1321b09c91ee8f2d6a5e86a 100644 (file)
@@ -384,6 +384,28 @@ public class TmfExperiment extends TmfTrace implements ITmfEventParser {
         return event;
     }
 
+    /* (non-Javadoc)
+     * @see org.eclipse.linuxtools.tmf.core.trace.TmfTrace#getInitialRangeOffset()
+     */
+    /**
+     * @since 2.0
+     */
+    @Override
+    public ITmfTimestamp getInitialRangeOffset() {
+        if ((fTraces == null) || (fTraces.length == 0)) {
+            return super.getInitialRangeOffset();
+        }
+
+        ITmfTimestamp initTs = TmfTimestamp.BIG_CRUNCH;
+        for (int i = 0; i < fTraces.length; i++) {
+            ITmfTimestamp ts = fTraces[i].getInitialRangeOffset();
+            if (ts.compareTo(initTs) < 0) {
+                initTs = ts;
+            }
+        }
+        return initTs;
+    }
+
     /* (non-Javadoc)
      * @see java.lang.Object#toString()
      */
This page took 0.0239 seconds and 5 git commands to generate.