tmf: Add a method to query an ongoing state's start time
[deliverable/tracecompass.git] / org.eclipse.linuxtools.tmf.core / src / org / eclipse / linuxtools / internal / tmf / core / statesystem / TransientState.java
index 19ec969c647a8b0d28b0284c34c7a7ef5fb6e3b5..1fae851b79620611a11ad2f56d6e8c8b38fc4d94 100644 (file)
@@ -68,16 +68,18 @@ class TransientState {
         return latestTime;
     }
 
-    ITmfStateValue getOngoingStateValue(int index)
-            throws AttributeNotFoundException {
-
+    ITmfStateValue getOngoingStateValue(int index) throws AttributeNotFoundException {
         checkValidAttribute(index);
         return ongoingStateInfo.get(index);
     }
 
+    long getOngoingStartTime(int index) throws AttributeNotFoundException {
+        checkValidAttribute(index);
+        return ongoingStateStartTimes.get(index);
+    }
+
     void changeOngoingStateValue(int index, ITmfStateValue newValue)
             throws AttributeNotFoundException {
-
         checkValidAttribute(index);
         ongoingStateInfo.set(index, newValue);
     }
@@ -89,17 +91,13 @@ class TransientState {
      * @param quark
      * @throws AttributeNotFoundException
      */
-    ITmfStateInterval getOngoingInterval(int quark)
-            throws AttributeNotFoundException {
-
+    ITmfStateInterval getOngoingInterval(int quark) throws AttributeNotFoundException {
         checkValidAttribute(quark);
         return new TmfStateInterval(ongoingStateStartTimes.get(quark), -1, quark,
                 ongoingStateInfo.get(quark));
     }
 
-    private void checkValidAttribute(int quark)
-            throws AttributeNotFoundException {
-
+    private void checkValidAttribute(int quark) throws AttributeNotFoundException {
         if (quark > ongoingStateInfo.size() - 1 || quark < 0) {
             throw new AttributeNotFoundException();
         }
This page took 0.026124 seconds and 5 git commands to generate.