ss: Move selectNextChildren to CoreNode and return sequenceNumber
[deliverable/tracecompass.git] / statesystem / org.eclipse.tracecompass.statesystem.core / src / org / eclipse / tracecompass / internal / statesystem / core / backend / historytree / ParentNode.java
index 34b798d6e3d7892d6106c393d87325d40906634e..15003bdf4a1b204021c43e54965dae8f242172ab 100644 (file)
@@ -9,6 +9,10 @@
 
 package org.eclipse.tracecompass.internal.statesystem.core.backend.historytree;
 
+import java.util.Collection;
+import org.eclipse.jdt.annotation.NonNull;
+import org.eclipse.tracecompass.statesystem.core.exceptions.TimeRangeException;
+
 /**
  * A Core node is a first-level node of a History Tree which is not a leaf node.
  *
@@ -67,13 +71,6 @@ public abstract class ParentNode extends HTNode {
      */
     public abstract long getChildStart(int index);
 
-    /**
-     * Get the start time of the latest (right-most) child node.
-     *
-     * @return The start time of the latest child
-     */
-    public abstract long getLatestChildStart();
-
     /**
      * Tell this node that it has a new child (Congrats!)
      *
@@ -82,4 +79,18 @@ public abstract class ParentNode extends HTNode {
      */
     public abstract void linkNewChild(HTNode childNode);
 
+    /**
+     * Inner method to select the sequence numbers for the children of the
+     * current node that intersect the given timestamp. Useful for moving down
+     * the tree.
+     *
+     * @param t
+     *            The timestamp to choose which child is the next one
+     * @return Collection of sequence numbers of the child nodes that intersect
+     *         t, non-null empty collection if this is a Leaf Node
+     * @throws TimeRangeException
+     *             If t is out of the node's range
+     */
+    public abstract @NonNull Collection<@NonNull Integer> selectNextChildren(long t);
+
 }
This page took 0.025288 seconds and 5 git commands to generate.