/** * Ensures that the bit set has the capacity to represent the given value. * * @param value {@code >= 0;} value to represent */ private void ensureCapacity(int value) { if (value >= Bits.getMax(bits)) { int[] newBits = Bits.makeBitSet( Math.max(value + 1, 2 * Bits.getMax(bits))); System.arraycopy(bits, 0, newBits, 0, bits.length); bits = newBits; } }
/** * Ensures that the bit set has the capacity to represent the given value. * * @param value {@code >= 0;} value to represent */ private void ensureCapacity(int value) { if (value >= Bits.getMax(bits)) { int[] newBits = Bits.makeBitSet( Math.max(value + 1, 2 * Bits.getMax(bits))); System.arraycopy(bits, 0, newBits, 0, bits.length); bits = newBits; } }
/** * Ensures that the bit set has the capacity to represent the given value. * * @param value {@code >= 0;} value to represent */ private void ensureCapacity(int value) { if (value >= Bits.getMax(bits)) { int[] newBits = Bits.makeBitSet( Math.max(value + 1, 2 * Bits.getMax(bits))); System.arraycopy(bits, 0, newBits, 0, bits.length); bits = newBits; } }
/** * Ensures that the bit set has the capacity to represent the given value. * * @param value {@code >= 0;} value to represent */ private void ensureCapacity(int value) { if (value >= Bits.getMax(bits)) { int[] newBits = Bits.makeBitSet( Math.max(value + 1, 2 * Bits.getMax(bits))); System.arraycopy(bits, 0, newBits, 0, bits.length); bits = newBits; } }
/** * Ensures that the bit set has the capacity to represent the given value. * * @param value {@code >= 0;} value to represent */ private void ensureCapacity(int value) { if (value >= Bits.getMax(bits)) { int[] newBits = Bits.makeBitSet( Math.max(value + 1, 2 * Bits.getMax(bits))); System.arraycopy(bits, 0, newBits, 0, bits.length); bits = newBits; } }
/** @inheritDoc */ public boolean has(int value) { return (value < Bits.getMax(bits)) && Bits.get(bits, value); }
/** @inheritDoc */ public void remove(int value) { if (value < Bits.getMax(bits)) { Bits.set(bits, value, false); } }
/** @inheritDoc */ public void remove(int value) { if (value < Bits.getMax(bits)) { Bits.set(bits, value, false); } }
/** @inheritDoc */ public void remove(int value) { if (value < Bits.getMax(bits)) { Bits.set(bits, value, false); } }
/** {@inheritDoc} */ @Override public boolean has(int value) { return (value < Bits.getMax(bits)) && Bits.get(bits, value); }
/** {@inheritDoc} */ @Override public boolean has(int value) { return (value < Bits.getMax(bits)) && Bits.get(bits, value); }
/** @inheritDoc */ public void remove(int value) { if (value < Bits.getMax(bits)) { Bits.set(bits, value, false); } }
/** {@inheritDoc} */ public void remove(int value) { if (value < Bits.getMax(bits)) { Bits.set(bits, value, false); } }
/** {@inheritDoc} */ @Override public void remove(int value) { if (value < Bits.getMax(bits)) { Bits.set(bits, value, false); } }
/** {@inheritDoc} */ public boolean has(int value) { return (value < Bits.getMax(bits)) && Bits.get(bits, value); }
/** @inheritDoc */ public void remove(int value) { if (value < Bits.getMax(bits)) { Bits.set(bits, value, false); } }
/** @inheritDoc */ public boolean has(int value) { return (value < Bits.getMax(bits)) && Bits.get(bits, value); }
/** @inheritDoc */ public boolean has(int value) { return (value < Bits.getMax(bits)) && Bits.get(bits, value); }
public void test_getMax() { for (int i = 0; i < 4000; i += 59) { int expect = i >> 5; if ((expect * 32) < i) { expect++; } assertEquals(label(i), expect * 32, Bits.getMax(new int[expect])); } }
public void test_getMax() { for (int i = 0; i < 4000; i += 59) { int expect = i >> 5; if ((expect * 32) < i) { expect++; } assertEquals(label(i), expect * 32, Bits.getMax(new int[expect])); } }