tmf: Also pick the interval at the end time of range queries
authorAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Tue, 15 May 2012 14:43:15 +0000 (10:43 -0400)
committerAlexandre Montplaisir <alexmonthy@voxpopuli.im>
Tue, 15 May 2012 18:00:54 +0000 (14:00 -0400)
When doing a range query with resolution, include the end time
of the range (t2) as the last "resolution point". This means
that the interval crossing t2 will be returned no matter what,
which is consistent with range queries with no resolution.

Signed-off-by: Alexandre Montplaisir <alexmonthy@voxpopuli.im>
org.eclipse.linuxtools.tmf.core/src/org/eclipse/linuxtools/internal/tmf/core/statesystem/StateHistorySystem.java

index 53748351b484374fbd196e1b39384f119cb93494..9fc11e715d8c4d50dbccf26777823ae9121fae17 100644 (file)
@@ -249,6 +249,13 @@ public class StateHistorySystem extends StateSystem implements
 
             intervals.add(currentInterval);
         }
+
+        /* Add the interval at t2, if it wasn't included already. */
+        if (currentInterval.getEndTime() < t2 &&
+                t2 <= this.getCurrentEndTime()) {
+            currentInterval = querySingleState(t2, attributeQuark);
+            intervals.add(currentInterval);
+        } 
         return intervals;
     }
 
This page took 0.028484 seconds and 5 git commands to generate.