@Test(groups="1s", timeOut=60000) public void testNextValueOut() { IntIterableBitSet is = new IntIterableBitSet(); is.addAll(1,2,3,5,7,8,9,10); Assert.assertEquals(is.nextValueOut(-10), -9); Assert.assertEquals(is.nextValueOut(-1), 0); Assert.assertEquals(is.nextValueOut(0), 4); Assert.assertEquals(is.nextValueOut(1), 4); Assert.assertEquals(is.nextValueOut(2), 4); Assert.assertEquals(is.nextValueOut(3), 4); Assert.assertEquals(is.nextValueOut(4), 6); Assert.assertEquals(is.nextValueOut(5), 6); Assert.assertEquals(is.nextValueOut(6), 11); Assert.assertEquals(is.nextValueOut(7), 11); Assert.assertEquals(is.nextValueOut(8), 11); Assert.assertEquals(is.nextValueOut(9), 11); Assert.assertEquals(is.nextValueOut(10), 11); Assert.assertEquals(is.nextValueOut(15), 16); }
@Override public int nextValueOut(int aValue) { int val = aValue - offset; if(val < -1 || val >= values.length()){ return aValue + 1; }else{ val = values.nextClearBit(val + 1); return val + offset; } }
IntIterableBitSet extends Set_BitSet implements IntIterableSet { @Override public int nextValueOut(int aValue) { int val = aValue - offset; if(val < -1 || val >= values.length()){ return aValue + 1; }else{ val = values.nextClearBit(val + 1); return val + offset; } } }
IntIterableBitSet extends Set_BitSet implements IntIterableSet { @Override public int nextValueOut(int aValue) { int val = aValue - offset; if(val < -1 || val >= values.length()){ return aValue + 1; }else{ val = values.nextClearBit(val + 1); return val + offset; } } IntIterableBitSet(); }
IntIterableBitSet extends Set_BitSet implements IntIterableSet { @Override public int nextValueOut(int aValue) { int val = aValue - offset; if(val < -1 || val >= values.length()){ return aValue + 1; }else{ val = values.nextClearBit(val + 1); return val + offset; } } IntIterableBitSet(); void setOffset(int offset); @Override boolean addAll(int... values); @Override boolean addAll(IntIterableSet set); @Override boolean retainAll(IntIterableSet set); @Override boolean removeAll(IntIterableSet set); @Override boolean removeBetween(int f, int t); @Override int nextValue(int aValue); @Override int nextValueOut(int aValue); @Override int previousValue(int aValue); @Override int previousValueOut(int aValue); String toString(); @Override IntIterableSet duplicate(); @Override void plus(int x); @Override void minus(int x); }
IntIterableBitSet extends Set_BitSet implements IntIterableSet { @Override public int nextValueOut(int aValue) { int val = aValue - offset; if(val < -1 || val >= values.length()){ return aValue + 1; }else{ val = values.nextClearBit(val + 1); return val + offset; } } IntIterableBitSet(); void setOffset(int offset); @Override boolean addAll(int... values); @Override boolean addAll(IntIterableSet set); @Override boolean retainAll(IntIterableSet set); @Override boolean removeAll(IntIterableSet set); @Override boolean removeBetween(int f, int t); @Override int nextValue(int aValue); @Override int nextValueOut(int aValue); @Override int previousValue(int aValue); @Override int previousValueOut(int aValue); String toString(); @Override IntIterableSet duplicate(); @Override void plus(int x); @Override void minus(int x);  }