@Test public void testRemove() { for (IntervalMap set : getAllInstances()) { Object[] defaultValues = getTestValues(set); set.put(new Interval(1.0, 2.0), defaultValues[0]); set.put(new Interval(3.0, 4.0), defaultValues[1]); Assert.assertTrue(set.remove(new Interval(1.0, 2.0))); Assert.assertFalse(set.contains(new Interval(1.0, 2.0))); Assert.assertEquals(set.get(new Interval(3.0, 4.0), defaultValues[0]), defaultValues[1]); Assert.assertTrue(set.remove(new Interval(3.0, 4.0))); Assert.assertTrue(set.isEmpty()); Assert.assertFalse(set.contains(new Interval(1.0, 2.0))); } }
@Override public boolean remove(Interval interval) { Object values = getValuesArray(); final int removeIndex = removeInner(interval.getLow(), interval.getHigh()); if (removeIndex >= 0) { if (removeIndex != size) { System.arraycopy(values, removeIndex + 1, values, removeIndex, size - removeIndex); } return true; } return false; }
IntervalMap implements TimeMap<Interval, T> { @Override public boolean remove(Interval interval) { Object values = getValuesArray(); final int removeIndex = removeInner(interval.getLow(), interval.getHigh()); if (removeIndex >= 0) { if (removeIndex != size) { System.arraycopy(values, removeIndex + 1, values, removeIndex, size - removeIndex); } return true; } return false; } }
IntervalMap implements TimeMap<Interval, T> { @Override public boolean remove(Interval interval) { Object values = getValuesArray(); final int removeIndex = removeInner(interval.getLow(), interval.getHigh()); if (removeIndex >= 0) { if (removeIndex != size) { System.arraycopy(values, removeIndex + 1, values, removeIndex, size - removeIndex); } return true; } return false; } IntervalMap();  IntervalMap(int capacity); protected  IntervalMap(double[] keys); }
IntervalMap implements TimeMap<Interval, T> { @Override public boolean remove(Interval interval) { Object values = getValuesArray(); final int removeIndex = removeInner(interval.getLow(), interval.getHigh()); if (removeIndex >= 0) { if (removeIndex != size) { System.arraycopy(values, removeIndex + 1, values, removeIndex, size - removeIndex); } return true; } return false; } IntervalMap();  IntervalMap(int capacity); protected  IntervalMap(double[] keys); @Override boolean put(Interval interval, T value); @Override boolean remove(Interval interval); @Override Object get(Interval interval, Estimator estimator); @Override T get(Interval interval, T defaultValue); @Override T[] toValuesArray(); @Override int size(); @Override boolean isEmpty(); boolean contains(double timestamp); @Override boolean contains(Interval interval); @Override Interval[] toKeysArray(); double[] getIntervals(); @Override void clear(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(TimeFormat timeFormat, DateTimeZone timeZone); @Override String toString(TimeFormat timeFormat); @Override String toString(); }
IntervalMap implements TimeMap<Interval, T> { @Override public boolean remove(Interval interval) { Object values = getValuesArray(); final int removeIndex = removeInner(interval.getLow(), interval.getHigh()); if (removeIndex >= 0) { if (removeIndex != size) { System.arraycopy(values, removeIndex + 1, values, removeIndex, size - removeIndex); } return true; } return false; } IntervalMap();  IntervalMap(int capacity); protected  IntervalMap(double[] keys); @Override boolean put(Interval interval, T value); @Override boolean remove(Interval interval); @Override Object get(Interval interval, Estimator estimator); @Override T get(Interval interval, T defaultValue); @Override T[] toValuesArray(); @Override int size(); @Override boolean isEmpty(); boolean contains(double timestamp); @Override boolean contains(Interval interval); @Override Interval[] toKeysArray(); double[] getIntervals(); @Override void clear(); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(TimeFormat timeFormat, DateTimeZone timeZone); @Override String toString(TimeFormat timeFormat); @Override String toString();  }