@Test public void testNegativeAdd() { MutableRoaringBitmap bitmap = new MutableRoaringBitmap(); bitmap.add(-7); assertEquals("{4294967289}", bitmap.toString()); }
@Override public String toString() { final StringBuilder answer = new StringBuilder(); final IntIterator i = this.getIntIterator(); answer.append("{"); if (i.hasNext()) { answer.append(i.next() & 0xFFFFFFFFL); } while (i.hasNext()) { answer.append(","); if(answer.length() > 0x80000) { answer.append("..."); break; } answer.append(i.next() & 0xFFFFFFFFL); } answer.append("}"); return answer.toString(); }
ImmutableRoaringBitmap implements Iterable<Integer>, Cloneable, ImmutableBitmapDataProvider { @Override public String toString() { final StringBuilder answer = new StringBuilder(); final IntIterator i = this.getIntIterator(); answer.append("{"); if (i.hasNext()) { answer.append(i.next() & 0xFFFFFFFFL); } while (i.hasNext()) { answer.append(","); if(answer.length() > 0x80000) { answer.append("..."); break; } answer.append(i.next() & 0xFFFFFFFFL); } answer.append("}"); return answer.toString(); } }
ImmutableRoaringBitmap implements Iterable<Integer>, Cloneable, ImmutableBitmapDataProvider { @Override public String toString() { final StringBuilder answer = new StringBuilder(); final IntIterator i = this.getIntIterator(); answer.append("{"); if (i.hasNext()) { answer.append(i.next() & 0xFFFFFFFFL); } while (i.hasNext()) { answer.append(","); if(answer.length() > 0x80000) { answer.append("..."); break; } answer.append(i.next() & 0xFFFFFFFFL); } answer.append("}"); return answer.toString(); } protected  ImmutableRoaringBitmap();  ImmutableRoaringBitmap(final ByteBuffer b); }
ImmutableRoaringBitmap implements Iterable<Integer>, Cloneable, ImmutableBitmapDataProvider { @Override public String toString() { final StringBuilder answer = new StringBuilder(); final IntIterator i = this.getIntIterator(); answer.append("{"); if (i.hasNext()) { answer.append(i.next() & 0xFFFFFFFFL); } while (i.hasNext()) { answer.append(","); if(answer.length() > 0x80000) { answer.append("..."); break; } answer.append(i.next() & 0xFFFFFFFFL); } answer.append("}"); return answer.toString(); } protected  ImmutableRoaringBitmap();  ImmutableRoaringBitmap(final ByteBuffer b); static MutableRoaringBitmap and(final Iterator<? extends ImmutableRoaringBitmap> bitmaps,
      final long rangeStart, final long rangeEnd); @Deprecated static MutableRoaringBitmap and(final Iterator<? extends ImmutableRoaringBitmap> bitmaps,
      final int rangeStart, final int rangeEnd); static MutableRoaringBitmap and(final ImmutableRoaringBitmap x1,
      final ImmutableRoaringBitmap x2); static int andCardinality(final ImmutableRoaringBitmap x1,
      final ImmutableRoaringBitmap x2); static int xorCardinality(final ImmutableRoaringBitmap x1,
                                   final ImmutableRoaringBitmap x2); static int andNotCardinality(final ImmutableRoaringBitmap x1,
                                      final ImmutableRoaringBitmap x2); static MutableRoaringBitmap andNot(final ImmutableRoaringBitmap x1,
      final ImmutableRoaringBitmap x2, long rangeStart, long rangeEnd); @Deprecated static MutableRoaringBitmap andNot(final ImmutableRoaringBitmap x1,
                                              final ImmutableRoaringBitmap x2,
                                              final int rangeStart, final int rangeEnd); static MutableRoaringBitmap andNot(final ImmutableRoaringBitmap x1,
      final ImmutableRoaringBitmap x2); static MutableRoaringBitmap orNot(
          final ImmutableRoaringBitmap x1, final ImmutableRoaringBitmap x2, long rangeEnd); static ImmutableRoaringBitmap bitmapOf(final int... data); static MutableRoaringBitmap flip(ImmutableRoaringBitmap bm, final long rangeStart,
      final long rangeEnd); @Deprecated static MutableRoaringBitmap flip(ImmutableRoaringBitmap bm,
                                            final int rangeStart, final int rangeEnd); static boolean intersects(final ImmutableRoaringBitmap x1,
      final ImmutableRoaringBitmap x2); static MutableRoaringBitmap or(ImmutableRoaringBitmap... bitmaps); static MutableRoaringBitmap or(final ImmutableRoaringBitmap x1,
      final ImmutableRoaringBitmap x2); static MutableRoaringBitmap or(Iterator<? extends ImmutableRoaringBitmap> bitmaps); static MutableRoaringBitmap or(final Iterator<? extends ImmutableRoaringBitmap> bitmaps,
      final long rangeStart, final long rangeEnd); @Deprecated static MutableRoaringBitmap or(final Iterator<? extends ImmutableRoaringBitmap> bitmaps,
          final int rangeStart, final int rangeEnd); static int orCardinality(final ImmutableRoaringBitmap x1,
      final ImmutableRoaringBitmap x2); static MutableRoaringBitmap xor(final Iterator<? extends ImmutableRoaringBitmap> bitmaps,
      final long rangeStart, final long rangeEnd); @Deprecated static MutableRoaringBitmap xor(final Iterator<? extends ImmutableRoaringBitmap> bitmaps,
          final int rangeStart, final int rangeEnd); static MutableRoaringBitmap xor(final ImmutableRoaringBitmap x1,
      final ImmutableRoaringBitmap x2); @Override ImmutableRoaringBitmap clone(); @Override boolean contains(final int x); boolean contains(long minimum, long supremum); boolean contains(ImmutableRoaringBitmap subset); @Override boolean equals(Object o); boolean isHammingSimilar(ImmutableRoaringBitmap other, int tolerance); boolean intersects(long minimum, long supremum); @Override long getLongCardinality(); @Override int getCardinality(); @Override void forEach(IntConsumer ic); MappeableContainerPointer getContainerPointer(); @Override PeekableIntIterator getIntIterator(); @Override IntIterator getReverseIntIterator(); @Override BatchIterator getBatchIterator(); @Override long getLongSizeInBytes(); @Override int getSizeInBytes(); @Override int hashCode(); boolean hasRunCompression(); @Override boolean isEmpty(); @Override Iterator<Integer> iterator(); @Override MutableRoaringBitmap limit(int maxcardinality); @Override long rankLong(int x); @Override long rangeCardinality(long start, long end); @Override int rank(int x); @Override int select(int j); @Override int first(); @Override int last(); @Override long nextValue(int fromValue); @Override long previousValue(int fromValue); @Override long nextAbsentValue(int fromValue); @Override long previousAbsentValue(int fromValue); @Override void serialize(DataOutput out); @Override void serialize(ByteBuffer buffer); @Override int serializedSizeInBytes(); @Override int[] toArray(); MutableRoaringBitmap toMutableRoaringBitmap(); RoaringBitmap toRoaringBitmap(); @Override String toString(); }
ImmutableRoaringBitmap implements Iterable<Integer>, Cloneable, ImmutableBitmapDataProvider { @Override public String toString() { final StringBuilder answer = new StringBuilder(); final IntIterator i = this.getIntIterator(); answer.append("{"); if (i.hasNext()) { answer.append(i.next() & 0xFFFFFFFFL); } while (i.hasNext()) { answer.append(","); if(answer.length() > 0x80000) { answer.append("..."); break; } answer.append(i.next() & 0xFFFFFFFFL); } answer.append("}"); return answer.toString(); } protected  ImmutableRoaringBitmap();  ImmutableRoaringBitmap(final ByteBuffer b); static MutableRoaringBitmap and(final Iterator<? extends ImmutableRoaringBitmap> bitmaps,
      final long rangeStart, final long rangeEnd); @Deprecated static MutableRoaringBitmap and(final Iterator<? extends ImmutableRoaringBitmap> bitmaps,
      final int rangeStart, final int rangeEnd); static MutableRoaringBitmap and(final ImmutableRoaringBitmap x1,
      final ImmutableRoaringBitmap x2); static int andCardinality(final ImmutableRoaringBitmap x1,
      final ImmutableRoaringBitmap x2); static int xorCardinality(final ImmutableRoaringBitmap x1,
                                   final ImmutableRoaringBitmap x2); static int andNotCardinality(final ImmutableRoaringBitmap x1,
                                      final ImmutableRoaringBitmap x2); static MutableRoaringBitmap andNot(final ImmutableRoaringBitmap x1,
      final ImmutableRoaringBitmap x2, long rangeStart, long rangeEnd); @Deprecated static MutableRoaringBitmap andNot(final ImmutableRoaringBitmap x1,
                                              final ImmutableRoaringBitmap x2,
                                              final int rangeStart, final int rangeEnd); static MutableRoaringBitmap andNot(final ImmutableRoaringBitmap x1,
      final ImmutableRoaringBitmap x2); static MutableRoaringBitmap orNot(
          final ImmutableRoaringBitmap x1, final ImmutableRoaringBitmap x2, long rangeEnd); static ImmutableRoaringBitmap bitmapOf(final int... data); static MutableRoaringBitmap flip(ImmutableRoaringBitmap bm, final long rangeStart,
      final long rangeEnd); @Deprecated static MutableRoaringBitmap flip(ImmutableRoaringBitmap bm,
                                            final int rangeStart, final int rangeEnd); static boolean intersects(final ImmutableRoaringBitmap x1,
      final ImmutableRoaringBitmap x2); static MutableRoaringBitmap or(ImmutableRoaringBitmap... bitmaps); static MutableRoaringBitmap or(final ImmutableRoaringBitmap x1,
      final ImmutableRoaringBitmap x2); static MutableRoaringBitmap or(Iterator<? extends ImmutableRoaringBitmap> bitmaps); static MutableRoaringBitmap or(final Iterator<? extends ImmutableRoaringBitmap> bitmaps,
      final long rangeStart, final long rangeEnd); @Deprecated static MutableRoaringBitmap or(final Iterator<? extends ImmutableRoaringBitmap> bitmaps,
          final int rangeStart, final int rangeEnd); static int orCardinality(final ImmutableRoaringBitmap x1,
      final ImmutableRoaringBitmap x2); static MutableRoaringBitmap xor(final Iterator<? extends ImmutableRoaringBitmap> bitmaps,
      final long rangeStart, final long rangeEnd); @Deprecated static MutableRoaringBitmap xor(final Iterator<? extends ImmutableRoaringBitmap> bitmaps,
          final int rangeStart, final int rangeEnd); static MutableRoaringBitmap xor(final ImmutableRoaringBitmap x1,
      final ImmutableRoaringBitmap x2); @Override ImmutableRoaringBitmap clone(); @Override boolean contains(final int x); boolean contains(long minimum, long supremum); boolean contains(ImmutableRoaringBitmap subset); @Override boolean equals(Object o); boolean isHammingSimilar(ImmutableRoaringBitmap other, int tolerance); boolean intersects(long minimum, long supremum); @Override long getLongCardinality(); @Override int getCardinality(); @Override void forEach(IntConsumer ic); MappeableContainerPointer getContainerPointer(); @Override PeekableIntIterator getIntIterator(); @Override IntIterator getReverseIntIterator(); @Override BatchIterator getBatchIterator(); @Override long getLongSizeInBytes(); @Override int getSizeInBytes(); @Override int hashCode(); boolean hasRunCompression(); @Override boolean isEmpty(); @Override Iterator<Integer> iterator(); @Override MutableRoaringBitmap limit(int maxcardinality); @Override long rankLong(int x); @Override long rangeCardinality(long start, long end); @Override int rank(int x); @Override int select(int j); @Override int first(); @Override int last(); @Override long nextValue(int fromValue); @Override long previousValue(int fromValue); @Override long nextAbsentValue(int fromValue); @Override long previousAbsentValue(int fromValue); @Override void serialize(DataOutput out); @Override void serialize(ByteBuffer buffer); @Override int serializedSizeInBytes(); @Override int[] toArray(); MutableRoaringBitmap toMutableRoaringBitmap(); RoaringBitmap toRoaringBitmap(); @Override String toString();  }