@Test public void orNot() { final RoaringBitmap rb = new RoaringBitmap(); final RoaringBitmap rb2 = new RoaringBitmap(); rb.add(2); rb.add(1); rb.add(1 << 16); rb.add(2 << 16); rb.add(3 << 16); rb2.add(1 << 16); rb2.add(3 << 16); rb.orNot(rb2, (4 << 16) - 1); assertEquals((4 << 16) - 1, rb.getCardinality()); final IntIterator iterator = rb.getIntIterator(); for (int i = 0; i < (4 << 16) - 1; ++i) { assertTrue(iterator.hasNext(), "Error on iteration " + i); assertEquals(i, iterator.next()); } assertFalse(iterator.hasNext()); }
public void orNot(final RoaringBitmap other, long rangeEnd) { rangeSanityCheck(0, rangeEnd); int maxKey = (int)((rangeEnd - 1) >>> 16); int lastRun = (rangeEnd & 0xFFFF) == 0 ? 0x10000 : (int)(rangeEnd & 0xFFFF); int size = 0; int pos1 = 0, pos2 = 0; int length1 = highLowContainer.size(), length2 = other.highLowContainer.size(); int s1 = length1 > 0 ? highLowContainer.getKeyAtIndex(pos1) : maxKey + 1; int s2 = length2 > 0 ? other.highLowContainer.getKeyAtIndex(pos2) : maxKey + 1; int remainder = 0; for (int i = highLowContainer.size - 1; i >= 0 && highLowContainer.keys[i] > maxKey; --i) { ++remainder; } int correction = 0; for (int i = 0; i < other.highLowContainer.size - remainder; ++i) { correction += other.highLowContainer.getContainerAtIndex(i).isFull() ? 1 : 0; if (other.highLowContainer.getKeyAtIndex(i) >= maxKey) { break; } } int maxSize = Math.min(maxKey + 1 + remainder - correction + highLowContainer.size, 0x10000); if (maxSize == 0) { return; } char[] newKeys = new char[maxSize]; Container[] newValues = new Container[maxSize]; for (int key = 0; key <= maxKey && size < maxSize; ++key) { if (key == s1 && key == s2) { newValues[size] = highLowContainer.getContainerAtIndex(pos1) .iorNot(other.highLowContainer.getContainerAtIndex(pos2), key == maxKey ? lastRun : 0x10000); ++pos1; ++pos2; s1 = pos1 < length1 ? highLowContainer.getKeyAtIndex(pos1) : maxKey + 1; s2 = pos2 < length2 ? other.highLowContainer.getKeyAtIndex(pos2) : maxKey + 1; } else if (key == s1) { newValues[size] = highLowContainer.getContainerAtIndex(pos1) .ior(key == maxKey ? RunContainer.rangeOfOnes(0, lastRun) : RunContainer.full()); ++pos1; s1 = pos1 < length1 ? highLowContainer.getKeyAtIndex(pos1) : maxKey + 1; } else if (key == s2) { newValues[size] = other.highLowContainer.getContainerAtIndex(pos2) .not(0, key == maxKey ? lastRun : 0x10000); ++pos2; s2 = pos2 < length2 ? other.highLowContainer.getKeyAtIndex(pos2) : maxKey + 1; } else { newValues[size] = key == maxKey ? RunContainer.rangeOfOnes(0, lastRun) : RunContainer.full(); } if (newValues[size].isEmpty()) { newValues[size] = null; } else { newKeys[size] = (char)key; ++size; } } if (remainder > 0) { System.arraycopy(highLowContainer.keys, highLowContainer.size - remainder, newKeys, size, remainder); System.arraycopy(highLowContainer.values, highLowContainer.size - remainder, newValues, size, remainder); } highLowContainer.keys = newKeys; highLowContainer.values = newValues; highLowContainer.size = size + remainder; }
RoaringBitmap implements Cloneable, Serializable, Iterable<Integer>, Externalizable,
    ImmutableBitmapDataProvider, BitmapDataProvider, AppendableStorage<Container> { public void orNot(final RoaringBitmap other, long rangeEnd) { rangeSanityCheck(0, rangeEnd); int maxKey = (int)((rangeEnd - 1) >>> 16); int lastRun = (rangeEnd & 0xFFFF) == 0 ? 0x10000 : (int)(rangeEnd & 0xFFFF); int size = 0; int pos1 = 0, pos2 = 0; int length1 = highLowContainer.size(), length2 = other.highLowContainer.size(); int s1 = length1 > 0 ? highLowContainer.getKeyAtIndex(pos1) : maxKey + 1; int s2 = length2 > 0 ? other.highLowContainer.getKeyAtIndex(pos2) : maxKey + 1; int remainder = 0; for (int i = highLowContainer.size - 1; i >= 0 && highLowContainer.keys[i] > maxKey; --i) { ++remainder; } int correction = 0; for (int i = 0; i < other.highLowContainer.size - remainder; ++i) { correction += other.highLowContainer.getContainerAtIndex(i).isFull() ? 1 : 0; if (other.highLowContainer.getKeyAtIndex(i) >= maxKey) { break; } } int maxSize = Math.min(maxKey + 1 + remainder - correction + highLowContainer.size, 0x10000); if (maxSize == 0) { return; } char[] newKeys = new char[maxSize]; Container[] newValues = new Container[maxSize]; for (int key = 0; key <= maxKey && size < maxSize; ++key) { if (key == s1 && key == s2) { newValues[size] = highLowContainer.getContainerAtIndex(pos1) .iorNot(other.highLowContainer.getContainerAtIndex(pos2), key == maxKey ? lastRun : 0x10000); ++pos1; ++pos2; s1 = pos1 < length1 ? highLowContainer.getKeyAtIndex(pos1) : maxKey + 1; s2 = pos2 < length2 ? other.highLowContainer.getKeyAtIndex(pos2) : maxKey + 1; } else if (key == s1) { newValues[size] = highLowContainer.getContainerAtIndex(pos1) .ior(key == maxKey ? RunContainer.rangeOfOnes(0, lastRun) : RunContainer.full()); ++pos1; s1 = pos1 < length1 ? highLowContainer.getKeyAtIndex(pos1) : maxKey + 1; } else if (key == s2) { newValues[size] = other.highLowContainer.getContainerAtIndex(pos2) .not(0, key == maxKey ? lastRun : 0x10000); ++pos2; s2 = pos2 < length2 ? other.highLowContainer.getKeyAtIndex(pos2) : maxKey + 1; } else { newValues[size] = key == maxKey ? RunContainer.rangeOfOnes(0, lastRun) : RunContainer.full(); } if (newValues[size].isEmpty()) { newValues[size] = null; } else { newKeys[size] = (char)key; ++size; } } if (remainder > 0) { System.arraycopy(highLowContainer.keys, highLowContainer.size - remainder, newKeys, size, remainder); System.arraycopy(highLowContainer.values, highLowContainer.size - remainder, newValues, size, remainder); } highLowContainer.keys = newKeys; highLowContainer.values = newValues; highLowContainer.size = size + remainder; } }
RoaringBitmap implements Cloneable, Serializable, Iterable<Integer>, Externalizable,
    ImmutableBitmapDataProvider, BitmapDataProvider, AppendableStorage<Container> { public void orNot(final RoaringBitmap other, long rangeEnd) { rangeSanityCheck(0, rangeEnd); int maxKey = (int)((rangeEnd - 1) >>> 16); int lastRun = (rangeEnd & 0xFFFF) == 0 ? 0x10000 : (int)(rangeEnd & 0xFFFF); int size = 0; int pos1 = 0, pos2 = 0; int length1 = highLowContainer.size(), length2 = other.highLowContainer.size(); int s1 = length1 > 0 ? highLowContainer.getKeyAtIndex(pos1) : maxKey + 1; int s2 = length2 > 0 ? other.highLowContainer.getKeyAtIndex(pos2) : maxKey + 1; int remainder = 0; for (int i = highLowContainer.size - 1; i >= 0 && highLowContainer.keys[i] > maxKey; --i) { ++remainder; } int correction = 0; for (int i = 0; i < other.highLowContainer.size - remainder; ++i) { correction += other.highLowContainer.getContainerAtIndex(i).isFull() ? 1 : 0; if (other.highLowContainer.getKeyAtIndex(i) >= maxKey) { break; } } int maxSize = Math.min(maxKey + 1 + remainder - correction + highLowContainer.size, 0x10000); if (maxSize == 0) { return; } char[] newKeys = new char[maxSize]; Container[] newValues = new Container[maxSize]; for (int key = 0; key <= maxKey && size < maxSize; ++key) { if (key == s1 && key == s2) { newValues[size] = highLowContainer.getContainerAtIndex(pos1) .iorNot(other.highLowContainer.getContainerAtIndex(pos2), key == maxKey ? lastRun : 0x10000); ++pos1; ++pos2; s1 = pos1 < length1 ? highLowContainer.getKeyAtIndex(pos1) : maxKey + 1; s2 = pos2 < length2 ? other.highLowContainer.getKeyAtIndex(pos2) : maxKey + 1; } else if (key == s1) { newValues[size] = highLowContainer.getContainerAtIndex(pos1) .ior(key == maxKey ? RunContainer.rangeOfOnes(0, lastRun) : RunContainer.full()); ++pos1; s1 = pos1 < length1 ? highLowContainer.getKeyAtIndex(pos1) : maxKey + 1; } else if (key == s2) { newValues[size] = other.highLowContainer.getContainerAtIndex(pos2) .not(0, key == maxKey ? lastRun : 0x10000); ++pos2; s2 = pos2 < length2 ? other.highLowContainer.getKeyAtIndex(pos2) : maxKey + 1; } else { newValues[size] = key == maxKey ? RunContainer.rangeOfOnes(0, lastRun) : RunContainer.full(); } if (newValues[size].isEmpty()) { newValues[size] = null; } else { newKeys[size] = (char)key; ++size; } } if (remainder > 0) { System.arraycopy(highLowContainer.keys, highLowContainer.size - remainder, newKeys, size, remainder); System.arraycopy(highLowContainer.values, highLowContainer.size - remainder, newValues, size, remainder); } highLowContainer.keys = newKeys; highLowContainer.values = newValues; highLowContainer.size = size + remainder; } RoaringBitmap();   RoaringBitmap(RoaringArray highLowContainer);  RoaringBitmap(ImmutableRoaringBitmap rb); }
RoaringBitmap implements Cloneable, Serializable, Iterable<Integer>, Externalizable,
    ImmutableBitmapDataProvider, BitmapDataProvider, AppendableStorage<Container> { public void orNot(final RoaringBitmap other, long rangeEnd) { rangeSanityCheck(0, rangeEnd); int maxKey = (int)((rangeEnd - 1) >>> 16); int lastRun = (rangeEnd & 0xFFFF) == 0 ? 0x10000 : (int)(rangeEnd & 0xFFFF); int size = 0; int pos1 = 0, pos2 = 0; int length1 = highLowContainer.size(), length2 = other.highLowContainer.size(); int s1 = length1 > 0 ? highLowContainer.getKeyAtIndex(pos1) : maxKey + 1; int s2 = length2 > 0 ? other.highLowContainer.getKeyAtIndex(pos2) : maxKey + 1; int remainder = 0; for (int i = highLowContainer.size - 1; i >= 0 && highLowContainer.keys[i] > maxKey; --i) { ++remainder; } int correction = 0; for (int i = 0; i < other.highLowContainer.size - remainder; ++i) { correction += other.highLowContainer.getContainerAtIndex(i).isFull() ? 1 : 0; if (other.highLowContainer.getKeyAtIndex(i) >= maxKey) { break; } } int maxSize = Math.min(maxKey + 1 + remainder - correction + highLowContainer.size, 0x10000); if (maxSize == 0) { return; } char[] newKeys = new char[maxSize]; Container[] newValues = new Container[maxSize]; for (int key = 0; key <= maxKey && size < maxSize; ++key) { if (key == s1 && key == s2) { newValues[size] = highLowContainer.getContainerAtIndex(pos1) .iorNot(other.highLowContainer.getContainerAtIndex(pos2), key == maxKey ? lastRun : 0x10000); ++pos1; ++pos2; s1 = pos1 < length1 ? highLowContainer.getKeyAtIndex(pos1) : maxKey + 1; s2 = pos2 < length2 ? other.highLowContainer.getKeyAtIndex(pos2) : maxKey + 1; } else if (key == s1) { newValues[size] = highLowContainer.getContainerAtIndex(pos1) .ior(key == maxKey ? RunContainer.rangeOfOnes(0, lastRun) : RunContainer.full()); ++pos1; s1 = pos1 < length1 ? highLowContainer.getKeyAtIndex(pos1) : maxKey + 1; } else if (key == s2) { newValues[size] = other.highLowContainer.getContainerAtIndex(pos2) .not(0, key == maxKey ? lastRun : 0x10000); ++pos2; s2 = pos2 < length2 ? other.highLowContainer.getKeyAtIndex(pos2) : maxKey + 1; } else { newValues[size] = key == maxKey ? RunContainer.rangeOfOnes(0, lastRun) : RunContainer.full(); } if (newValues[size].isEmpty()) { newValues[size] = null; } else { newKeys[size] = (char)key; ++size; } } if (remainder > 0) { System.arraycopy(highLowContainer.keys, highLowContainer.size - remainder, newKeys, size, remainder); System.arraycopy(highLowContainer.values, highLowContainer.size - remainder, newValues, size, remainder); } highLowContainer.keys = newKeys; highLowContainer.values = newValues; highLowContainer.size = size + remainder; } RoaringBitmap();   RoaringBitmap(RoaringArray highLowContainer);  RoaringBitmap(ImmutableRoaringBitmap rb); static RoaringBitmap addOffset(final RoaringBitmap x, long offset); static RoaringBitmap add(RoaringBitmap rb, final long rangeStart, final long rangeEnd); @Deprecated static RoaringBitmap add(RoaringBitmap rb, final int rangeStart, final int rangeEnd); static RoaringBitmap and(final RoaringBitmap x1, final RoaringBitmap x2); static int andCardinality(final RoaringBitmap x1, final RoaringBitmap x2); static RoaringBitmap andNot(final RoaringBitmap x1, final RoaringBitmap x2); void add(final int... dat); void addN(final int[] dat, final int offset, final int n); static RoaringBitmap bitmapOf(final int... dat); static RoaringBitmap bitmapOfUnordered(final int... data); static RoaringBitmap flip(RoaringBitmap bm, final long rangeStart, final long rangeEnd); @Deprecated static RoaringBitmap flip(RoaringBitmap rb, final int rangeStart, final int rangeEnd); static boolean intersects(final RoaringBitmap x1, final RoaringBitmap x2); static RoaringBitmap or(Iterator<? extends RoaringBitmap> bitmaps); static RoaringBitmap or(RoaringBitmap... bitmaps); static RoaringBitmap or(final RoaringBitmap x1, final RoaringBitmap x2); static int orCardinality(final RoaringBitmap x1, final RoaringBitmap x2); static int xorCardinality(final RoaringBitmap x1, final RoaringBitmap x2); static int andNotCardinality(final RoaringBitmap x1, final RoaringBitmap x2); static RoaringBitmap remove(RoaringBitmap rb, final long rangeStart, final long rangeEnd); @Deprecated static RoaringBitmap remove(RoaringBitmap rb, final int rangeStart, final int rangeEnd); static RoaringBitmap xor(final RoaringBitmap x1, final RoaringBitmap x2); @Override void add(final int x); void add(final long rangeStart, final long rangeEnd); @Deprecated void add(final int rangeStart, final int rangeEnd); boolean intersects(long minimum, long supremum); void and(final RoaringBitmap x2); static RoaringBitmap and(final Iterator<? extends RoaringBitmap> bitmaps,
      final long rangeStart, final long rangeEnd); @Deprecated static RoaringBitmap and(final Iterator<? extends RoaringBitmap> bitmaps,
      final int rangeStart, final int rangeEnd); void andNot(final RoaringBitmap x2); static RoaringBitmap andNot(final RoaringBitmap x1, final RoaringBitmap x2,
      long rangeStart, long rangeEnd); @Deprecated static RoaringBitmap andNot(final RoaringBitmap x1, final RoaringBitmap x2,
          final int rangeStart, final int rangeEnd); void orNot(final RoaringBitmap other, long rangeEnd); static RoaringBitmap orNot(
          final RoaringBitmap x1, final RoaringBitmap x2, long rangeEnd); boolean checkedAdd(final int x); boolean checkedRemove(final int x); void clear(); @Override RoaringBitmap clone(); @Override boolean contains(final int x); boolean contains(long minimum, long supremum); void deserialize(DataInput in, byte[] buffer); void deserialize(DataInput in); void deserialize(ByteBuffer bbf); @Override boolean equals(Object o); boolean isHammingSimilar(RoaringBitmap other, int tolerance); void flip(final int x); void flip(final long rangeStart, final long rangeEnd); @Deprecated void flip(final int rangeStart, final int rangeEnd); @Override long getLongCardinality(); @Override int getCardinality(); @Override void forEach(IntConsumer ic); ContainerPointer getContainerPointer(); @Override PeekableIntIterator getIntIterator(); @Override IntIterator getReverseIntIterator(); @Override RoaringBatchIterator getBatchIterator(); @Override long getLongSizeInBytes(); @Override int getSizeInBytes(); @Override int hashCode(); boolean hasRunCompression(); @Override boolean isEmpty(); @Override Iterator<Integer> iterator(); @Override RoaringBitmap limit(int maxcardinality); void or(final RoaringBitmap x2); static RoaringBitmap or(final Iterator<? extends RoaringBitmap> bitmaps,
      final long rangeStart, final long rangeEnd); @Deprecated static RoaringBitmap or(final Iterator<? extends RoaringBitmap> bitmaps,
          final int rangeStart, final int rangeEnd); @Override long rankLong(int x); @Override long rangeCardinality(long start, long end); @Override int rank(int x); @Override void readExternal(ObjectInput in); @Override void remove(final int x); void remove(final long rangeStart, final long rangeEnd); @Deprecated void remove(final int rangeStart, final int rangeEnd); boolean removeRunCompression(); boolean runOptimize(); boolean contains(RoaringBitmap subset); @Override int select(int j); @Override long nextValue(int fromValue); @Override long previousValue(int fromValue); @Override long nextAbsentValue(int fromValue); @Override long previousAbsentValue(int fromValue); @Override int first(); @Override int last(); @Override void serialize(DataOutput out); @Override void serialize(ByteBuffer buffer); static long maximumSerializedSize(long cardinality, long universe_size); @Override int serializedSizeInBytes(); @Override int[] toArray(); @Override void append(char key, Container container); MutableRoaringBitmap toMutableRoaringBitmap(); @Override String toString(); @Override void trim(); @Override void writeExternal(ObjectOutput out); void xor(final RoaringBitmap x2); static RoaringBitmap xor(final Iterator<? extends RoaringBitmap> bitmaps,
      final long rangeStart, final long rangeEnd); @Deprecated static RoaringBitmap xor(final Iterator<? extends RoaringBitmap> bitmaps,
          final int rangeStart, final int rangeEnd); }
RoaringBitmap implements Cloneable, Serializable, Iterable<Integer>, Externalizable,
    ImmutableBitmapDataProvider, BitmapDataProvider, AppendableStorage<Container> { public void orNot(final RoaringBitmap other, long rangeEnd) { rangeSanityCheck(0, rangeEnd); int maxKey = (int)((rangeEnd - 1) >>> 16); int lastRun = (rangeEnd & 0xFFFF) == 0 ? 0x10000 : (int)(rangeEnd & 0xFFFF); int size = 0; int pos1 = 0, pos2 = 0; int length1 = highLowContainer.size(), length2 = other.highLowContainer.size(); int s1 = length1 > 0 ? highLowContainer.getKeyAtIndex(pos1) : maxKey + 1; int s2 = length2 > 0 ? other.highLowContainer.getKeyAtIndex(pos2) : maxKey + 1; int remainder = 0; for (int i = highLowContainer.size - 1; i >= 0 && highLowContainer.keys[i] > maxKey; --i) { ++remainder; } int correction = 0; for (int i = 0; i < other.highLowContainer.size - remainder; ++i) { correction += other.highLowContainer.getContainerAtIndex(i).isFull() ? 1 : 0; if (other.highLowContainer.getKeyAtIndex(i) >= maxKey) { break; } } int maxSize = Math.min(maxKey + 1 + remainder - correction + highLowContainer.size, 0x10000); if (maxSize == 0) { return; } char[] newKeys = new char[maxSize]; Container[] newValues = new Container[maxSize]; for (int key = 0; key <= maxKey && size < maxSize; ++key) { if (key == s1 && key == s2) { newValues[size] = highLowContainer.getContainerAtIndex(pos1) .iorNot(other.highLowContainer.getContainerAtIndex(pos2), key == maxKey ? lastRun : 0x10000); ++pos1; ++pos2; s1 = pos1 < length1 ? highLowContainer.getKeyAtIndex(pos1) : maxKey + 1; s2 = pos2 < length2 ? other.highLowContainer.getKeyAtIndex(pos2) : maxKey + 1; } else if (key == s1) { newValues[size] = highLowContainer.getContainerAtIndex(pos1) .ior(key == maxKey ? RunContainer.rangeOfOnes(0, lastRun) : RunContainer.full()); ++pos1; s1 = pos1 < length1 ? highLowContainer.getKeyAtIndex(pos1) : maxKey + 1; } else if (key == s2) { newValues[size] = other.highLowContainer.getContainerAtIndex(pos2) .not(0, key == maxKey ? lastRun : 0x10000); ++pos2; s2 = pos2 < length2 ? other.highLowContainer.getKeyAtIndex(pos2) : maxKey + 1; } else { newValues[size] = key == maxKey ? RunContainer.rangeOfOnes(0, lastRun) : RunContainer.full(); } if (newValues[size].isEmpty()) { newValues[size] = null; } else { newKeys[size] = (char)key; ++size; } } if (remainder > 0) { System.arraycopy(highLowContainer.keys, highLowContainer.size - remainder, newKeys, size, remainder); System.arraycopy(highLowContainer.values, highLowContainer.size - remainder, newValues, size, remainder); } highLowContainer.keys = newKeys; highLowContainer.values = newValues; highLowContainer.size = size + remainder; } RoaringBitmap();   RoaringBitmap(RoaringArray highLowContainer);  RoaringBitmap(ImmutableRoaringBitmap rb); static RoaringBitmap addOffset(final RoaringBitmap x, long offset); static RoaringBitmap add(RoaringBitmap rb, final long rangeStart, final long rangeEnd); @Deprecated static RoaringBitmap add(RoaringBitmap rb, final int rangeStart, final int rangeEnd); static RoaringBitmap and(final RoaringBitmap x1, final RoaringBitmap x2); static int andCardinality(final RoaringBitmap x1, final RoaringBitmap x2); static RoaringBitmap andNot(final RoaringBitmap x1, final RoaringBitmap x2); void add(final int... dat); void addN(final int[] dat, final int offset, final int n); static RoaringBitmap bitmapOf(final int... dat); static RoaringBitmap bitmapOfUnordered(final int... data); static RoaringBitmap flip(RoaringBitmap bm, final long rangeStart, final long rangeEnd); @Deprecated static RoaringBitmap flip(RoaringBitmap rb, final int rangeStart, final int rangeEnd); static boolean intersects(final RoaringBitmap x1, final RoaringBitmap x2); static RoaringBitmap or(Iterator<? extends RoaringBitmap> bitmaps); static RoaringBitmap or(RoaringBitmap... bitmaps); static RoaringBitmap or(final RoaringBitmap x1, final RoaringBitmap x2); static int orCardinality(final RoaringBitmap x1, final RoaringBitmap x2); static int xorCardinality(final RoaringBitmap x1, final RoaringBitmap x2); static int andNotCardinality(final RoaringBitmap x1, final RoaringBitmap x2); static RoaringBitmap remove(RoaringBitmap rb, final long rangeStart, final long rangeEnd); @Deprecated static RoaringBitmap remove(RoaringBitmap rb, final int rangeStart, final int rangeEnd); static RoaringBitmap xor(final RoaringBitmap x1, final RoaringBitmap x2); @Override void add(final int x); void add(final long rangeStart, final long rangeEnd); @Deprecated void add(final int rangeStart, final int rangeEnd); boolean intersects(long minimum, long supremum); void and(final RoaringBitmap x2); static RoaringBitmap and(final Iterator<? extends RoaringBitmap> bitmaps,
      final long rangeStart, final long rangeEnd); @Deprecated static RoaringBitmap and(final Iterator<? extends RoaringBitmap> bitmaps,
      final int rangeStart, final int rangeEnd); void andNot(final RoaringBitmap x2); static RoaringBitmap andNot(final RoaringBitmap x1, final RoaringBitmap x2,
      long rangeStart, long rangeEnd); @Deprecated static RoaringBitmap andNot(final RoaringBitmap x1, final RoaringBitmap x2,
          final int rangeStart, final int rangeEnd); void orNot(final RoaringBitmap other, long rangeEnd); static RoaringBitmap orNot(
          final RoaringBitmap x1, final RoaringBitmap x2, long rangeEnd); boolean checkedAdd(final int x); boolean checkedRemove(final int x); void clear(); @Override RoaringBitmap clone(); @Override boolean contains(final int x); boolean contains(long minimum, long supremum); void deserialize(DataInput in, byte[] buffer); void deserialize(DataInput in); void deserialize(ByteBuffer bbf); @Override boolean equals(Object o); boolean isHammingSimilar(RoaringBitmap other, int tolerance); void flip(final int x); void flip(final long rangeStart, final long rangeEnd); @Deprecated void flip(final int rangeStart, final int rangeEnd); @Override long getLongCardinality(); @Override int getCardinality(); @Override void forEach(IntConsumer ic); ContainerPointer getContainerPointer(); @Override PeekableIntIterator getIntIterator(); @Override IntIterator getReverseIntIterator(); @Override RoaringBatchIterator getBatchIterator(); @Override long getLongSizeInBytes(); @Override int getSizeInBytes(); @Override int hashCode(); boolean hasRunCompression(); @Override boolean isEmpty(); @Override Iterator<Integer> iterator(); @Override RoaringBitmap limit(int maxcardinality); void or(final RoaringBitmap x2); static RoaringBitmap or(final Iterator<? extends RoaringBitmap> bitmaps,
      final long rangeStart, final long rangeEnd); @Deprecated static RoaringBitmap or(final Iterator<? extends RoaringBitmap> bitmaps,
          final int rangeStart, final int rangeEnd); @Override long rankLong(int x); @Override long rangeCardinality(long start, long end); @Override int rank(int x); @Override void readExternal(ObjectInput in); @Override void remove(final int x); void remove(final long rangeStart, final long rangeEnd); @Deprecated void remove(final int rangeStart, final int rangeEnd); boolean removeRunCompression(); boolean runOptimize(); boolean contains(RoaringBitmap subset); @Override int select(int j); @Override long nextValue(int fromValue); @Override long previousValue(int fromValue); @Override long nextAbsentValue(int fromValue); @Override long previousAbsentValue(int fromValue); @Override int first(); @Override int last(); @Override void serialize(DataOutput out); @Override void serialize(ByteBuffer buffer); static long maximumSerializedSize(long cardinality, long universe_size); @Override int serializedSizeInBytes(); @Override int[] toArray(); @Override void append(char key, Container container); MutableRoaringBitmap toMutableRoaringBitmap(); @Override String toString(); @Override void trim(); @Override void writeExternal(ObjectOutput out); void xor(final RoaringBitmap x2); static RoaringBitmap xor(final Iterator<? extends RoaringBitmap> bitmaps,
      final long rangeStart, final long rangeEnd); @Deprecated static RoaringBitmap xor(final Iterator<? extends RoaringBitmap> bitmaps,
          final int rangeStart, final int rangeEnd);  }