| Constructor and Description |
|---|
FastBitSet(int nbits)
Creates a bit set of size nbits
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Sets all of the bits in this BitSet to
false. |
void |
clear(int bitIndex)
Sets the bit specified by the index to
false. |
void |
ensureCapacity(int requiredBits)
Ensures that the BitSet can hold enough bits.
|
boolean |
flip(int bitIndex)
Sets the bit at the specified index to the complement of its
current value.
|
boolean |
get(int bitIndex)
Returns the value of the bit with the specified index.
|
void |
set(int bitIndex)
Sets the bit at the specified index to
true. |
int |
size()
Returns the number of bits of space actually in use by this
BitSet to represent bit values. |
public FastBitSet(int nbits)
nbits - the initial size of the bit set.public void ensureCapacity(int requiredBits)
requiredBits - the required number of bits.public boolean flip(int bitIndex)
bitIndex - the index of the bit to flippublic void set(int bitIndex)
true.bitIndex - a bit index.public void clear(int bitIndex)
false.bitIndex - the index of the bit to be cleared.public void clear()
false.public boolean get(int bitIndex)
true if the bit with the index bitIndex
is currently set in this BitSet; otherwise, the result
is false.bitIndex - the bit index.public int size()
BitSet to represent bit values.
The maximum element in the set is the size - 1st element.Copyright © 2019. All rights reserved.