@Test public void testGetMinWithInfinite() { Configuration config = new Configuration(); config.setTimeRepresentation(TimeRepresentation.INTERVAL); GraphModelImpl graphModel = new GraphModelImpl(config); TimeStore timeStore = graphModel.store.timeStore; IntervalIndexStore store = (IntervalIndexStore) timeStore.nodeIndexStore; store.add(new Interval(Double.NEGATIVE_INFINITY, 3.0)); Assert.assertEquals(store.mainIndex.getMinTimestamp(), 3.0); store.add(new Interval(2.0, 3.0)); Assert.assertEquals(store.mainIndex.getMinTimestamp(), 2.0); }
@Override public double getMinTimestamp() { if (mainIndex) { Interval2IntTreeMap sortedMap = (Interval2IntTreeMap) timestampIndexStore.timeSortedMap; if (!sortedMap.isEmpty()) { return sortedMap.getLow(); } } else { Interval2IntTreeMap sortedMap = (Interval2IntTreeMap) timestampIndexStore.timeSortedMap; if (!sortedMap.isEmpty()) { for (Map.Entry<Interval, Integer> entry : sortedMap.entrySet()) { int index = entry.getValue(); if (index < timestamps.length) { TimeIndexEntry intervalEntry = timestamps[index]; if (intervalEntry != null) { return entry.getKey().getLow(); } } } } } return Double.NEGATIVE_INFINITY; }
IntervalIndexImpl extends TimeIndexImpl<T, Interval, IntervalSet, IntervalMap<?>> { @Override public double getMinTimestamp() { if (mainIndex) { Interval2IntTreeMap sortedMap = (Interval2IntTreeMap) timestampIndexStore.timeSortedMap; if (!sortedMap.isEmpty()) { return sortedMap.getLow(); } } else { Interval2IntTreeMap sortedMap = (Interval2IntTreeMap) timestampIndexStore.timeSortedMap; if (!sortedMap.isEmpty()) { for (Map.Entry<Interval, Integer> entry : sortedMap.entrySet()) { int index = entry.getValue(); if (index < timestamps.length) { TimeIndexEntry intervalEntry = timestamps[index]; if (intervalEntry != null) { return entry.getKey().getLow(); } } } } } return Double.NEGATIVE_INFINITY; } }
IntervalIndexImpl extends TimeIndexImpl<T, Interval, IntervalSet, IntervalMap<?>> { @Override public double getMinTimestamp() { if (mainIndex) { Interval2IntTreeMap sortedMap = (Interval2IntTreeMap) timestampIndexStore.timeSortedMap; if (!sortedMap.isEmpty()) { return sortedMap.getLow(); } } else { Interval2IntTreeMap sortedMap = (Interval2IntTreeMap) timestampIndexStore.timeSortedMap; if (!sortedMap.isEmpty()) { for (Map.Entry<Interval, Integer> entry : sortedMap.entrySet()) { int index = entry.getValue(); if (index < timestamps.length) { TimeIndexEntry intervalEntry = timestamps[index]; if (intervalEntry != null) { return entry.getKey().getLow(); } } } } } return Double.NEGATIVE_INFINITY; } IntervalIndexImpl(TimeIndexStore<T, Interval, IntervalSet, IntervalMap<?>> store, boolean main); }
IntervalIndexImpl extends TimeIndexImpl<T, Interval, IntervalSet, IntervalMap<?>> { @Override public double getMinTimestamp() { if (mainIndex) { Interval2IntTreeMap sortedMap = (Interval2IntTreeMap) timestampIndexStore.timeSortedMap; if (!sortedMap.isEmpty()) { return sortedMap.getLow(); } } else { Interval2IntTreeMap sortedMap = (Interval2IntTreeMap) timestampIndexStore.timeSortedMap; if (!sortedMap.isEmpty()) { for (Map.Entry<Interval, Integer> entry : sortedMap.entrySet()) { int index = entry.getValue(); if (index < timestamps.length) { TimeIndexEntry intervalEntry = timestamps[index]; if (intervalEntry != null) { return entry.getKey().getLow(); } } } } } return Double.NEGATIVE_INFINITY; } IntervalIndexImpl(TimeIndexStore<T, Interval, IntervalSet, IntervalMap<?>> store, boolean main); @Override double getMinTimestamp(); @Override double getMaxTimestamp(); @Override ElementIterable get(double timestamp); @Override ElementIterable get(Interval interval); }
IntervalIndexImpl extends TimeIndexImpl<T, Interval, IntervalSet, IntervalMap<?>> { @Override public double getMinTimestamp() { if (mainIndex) { Interval2IntTreeMap sortedMap = (Interval2IntTreeMap) timestampIndexStore.timeSortedMap; if (!sortedMap.isEmpty()) { return sortedMap.getLow(); } } else { Interval2IntTreeMap sortedMap = (Interval2IntTreeMap) timestampIndexStore.timeSortedMap; if (!sortedMap.isEmpty()) { for (Map.Entry<Interval, Integer> entry : sortedMap.entrySet()) { int index = entry.getValue(); if (index < timestamps.length) { TimeIndexEntry intervalEntry = timestamps[index]; if (intervalEntry != null) { return entry.getKey().getLow(); } } } } } return Double.NEGATIVE_INFINITY; } IntervalIndexImpl(TimeIndexStore<T, Interval, IntervalSet, IntervalMap<?>> store, boolean main); @Override double getMinTimestamp(); @Override double getMaxTimestamp(); @Override ElementIterable get(double timestamp); @Override ElementIterable get(Interval interval);  }