@Test public void testToString() { assertEquals(jre.toString(), hppc.toString()); for (int i : new int[] {1, 10, 20, 5000}) { hppc.set(i); jre.set(i); } assertEquals(jre.toString(), hppc.toString()); }
@Override public String toString() { long bit = nextSetBit(0); if (bit < 0) { return "{}"; } final StringBuilder builder = new StringBuilder(); builder.append("{"); builder.append(Long.toString(bit)); while ((bit = nextSetBit(bit + 1)) >= 0) { builder.append(", "); builder.append(Long.toString(bit)); } builder.append("}"); return builder.toString(); }
BitSet implements Cloneable { @Override public String toString() { long bit = nextSetBit(0); if (bit < 0) { return "{}"; } final StringBuilder builder = new StringBuilder(); builder.append("{"); builder.append(Long.toString(bit)); while ((bit = nextSetBit(bit + 1)) >= 0) { builder.append(", "); builder.append(Long.toString(bit)); } builder.append("}"); return builder.toString(); } }
BitSet implements Cloneable { @Override public String toString() { long bit = nextSetBit(0); if (bit < 0) { return "{}"; } final StringBuilder builder = new StringBuilder(); builder.append("{"); builder.append(Long.toString(bit)); while ((bit = nextSetBit(bit + 1)) >= 0) { builder.append(", "); builder.append(Long.toString(bit)); } builder.append("}"); return builder.toString(); } BitSet();  BitSet(long numBits);  BitSet(long[] bits, int numWords); }
BitSet implements Cloneable { @Override public String toString() { long bit = nextSetBit(0); if (bit < 0) { return "{}"; } final StringBuilder builder = new StringBuilder(); builder.append("{"); builder.append(Long.toString(bit)); while ((bit = nextSetBit(bit + 1)) >= 0) { builder.append(", "); builder.append(Long.toString(bit)); } builder.append("}"); return builder.toString(); } BitSet();  BitSet(long numBits);  BitSet(long[] bits, int numWords); static BitSet newInstance(); BitSetIterator iterator(); long capacity(); long size(); long length(); boolean isEmpty(); boolean get(int index); boolean get(long index); void set(long index); void set(long startIndex, long endIndex); void clear(); void clear(long index); void clear(int startIndex, int endIndex); void clear(long startIndex, long endIndex); boolean getAndSet(int index); boolean getAndSet(long index); void flip(long index); boolean flipAndGet(int index); boolean flipAndGet(long index); void flip(long startIndex, long endIndex); long cardinality(); static long intersectionCount(BitSet a, BitSet b); static long unionCount(BitSet a, BitSet b); static long andNotCount(BitSet a, BitSet b); static long xorCount(BitSet a, BitSet b); int nextSetBit(int index); long nextSetBit(long index); @Override Object clone(); void intersect(BitSet other); void union(BitSet other); void remove(BitSet other); void xor(BitSet other); void and(BitSet other); void or(BitSet other); void andNot(BitSet other); boolean intersects(BitSet other); void ensureCapacityWords(int numWords); static long[] grow(long[] array, int minSize); static int getNextSize(int targetSize); void ensureCapacity(long numBits); void trimTrailingZeros(); static int bits2words(long numBits); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); IntLookupContainer asIntLookupContainer(); LongLookupContainer asLongLookupContainer(); }
BitSet implements Cloneable { @Override public String toString() { long bit = nextSetBit(0); if (bit < 0) { return "{}"; } final StringBuilder builder = new StringBuilder(); builder.append("{"); builder.append(Long.toString(bit)); while ((bit = nextSetBit(bit + 1)) >= 0) { builder.append(", "); builder.append(Long.toString(bit)); } builder.append("}"); return builder.toString(); } BitSet();  BitSet(long numBits);  BitSet(long[] bits, int numWords); static BitSet newInstance(); BitSetIterator iterator(); long capacity(); long size(); long length(); boolean isEmpty(); boolean get(int index); boolean get(long index); void set(long index); void set(long startIndex, long endIndex); void clear(); void clear(long index); void clear(int startIndex, int endIndex); void clear(long startIndex, long endIndex); boolean getAndSet(int index); boolean getAndSet(long index); void flip(long index); boolean flipAndGet(int index); boolean flipAndGet(long index); void flip(long startIndex, long endIndex); long cardinality(); static long intersectionCount(BitSet a, BitSet b); static long unionCount(BitSet a, BitSet b); static long andNotCount(BitSet a, BitSet b); static long xorCount(BitSet a, BitSet b); int nextSetBit(int index); long nextSetBit(long index); @Override Object clone(); void intersect(BitSet other); void union(BitSet other); void remove(BitSet other); void xor(BitSet other); void and(BitSet other); void or(BitSet other); void andNot(BitSet other); boolean intersects(BitSet other); void ensureCapacityWords(int numWords); static long[] grow(long[] array, int minSize); static int getNextSize(int targetSize); void ensureCapacity(long numBits); void trimTrailingZeros(); static int bits2words(long numBits); @Override boolean equals(Object o); @Override int hashCode(); @Override String toString(); IntLookupContainer asIntLookupContainer(); LongLookupContainer asLongLookupContainer(); public long[] bits; public int wlen; }