+ @Override
+ public Collection<Integer> selectNextChildren(long t) throws TimeRangeException {
+ if (t < getNodeStart() || (isOnDisk() && t > getNodeEnd())) {
+ throw new TimeRangeException("Requesting children outside the node's range: " + t); //$NON-NLS-1$
+ }
+ rwl.readLock().lock();
+ try {
+ int potentialNextSeqNb = -1;
+ for (int i = 0; i < nbChildren; i++) {
+ if (t >= childStart[i]) {
+ potentialNextSeqNb = children[i];
+ } else {
+ break;
+ }
+ }
+
+ if (potentialNextSeqNb == -1) {
+ throw new IllegalStateException("No next child node found"); //$NON-NLS-1$
+ }
+ return Collections.singleton(potentialNextSeqNb);
+ } finally {
+ rwl.readLock().unlock();
+ }
+ }
+