segstore: introduce sorted iterators
[deliverable/tracecompass.git] / statesystem / org.eclipse.tracecompass.segmentstore.core / src / org / eclipse / tracecompass / internal / segmentstore / core / arraylist / LazyArrayListStore.java
index 1d6de72ec9d4a3565bc696e3a6df83c8f231c9d2..a9128c7b1773aef6f5c48b968b8ea6f28d658732 100644 (file)
@@ -265,29 +265,6 @@ public class LazyArrayListStore<@NonNull E extends ISegment> implements ISegment
     // Methods added by ISegmentStore
     // ------------------------------------------------------------------------
 
-    @Override
-    public Iterable<E> getIntersectingElements(long position) {
-        fLock.lock();
-        if (fDirty) {
-            sortStore();
-        }
-        /*
-         * The intervals intersecting 't' are those whose 1) start time is
-         * *lower* than 't' AND 2) end time is *higher* than 't'.
-         */
-        try {
-            /*
-             * as fStore is sorted by start then end times, restrict sub array
-             * to elements whose start times <= t as stream.filter won't do it.
-             */
-            int index = Collections.binarySearch(fStore, new BasicSegment(position, Long.MAX_VALUE));
-            index = (index >= 0) ? index : -index - 1;
-            return fStore.subList(0, index).stream().filter(element -> position >= element.getStart() && position <= element.getEnd()).collect(Collectors.toList());
-        } finally {
-            fLock.unlock();
-        }
-    }
-
     @Override
     public Iterable<E> getIntersectingElements(long start, long end) {
         fLock.lock();
This page took 0.023328 seconds and 5 git commands to generate.