public class LongBitSet
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable
Constructor and Description |
---|
LongBitSet(long nbits)
Creates a bit set whose initial size is large enough to explicitly
represent bits with indices in the range
0 through
nbits-1 . |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Sets all of the bits in this BitSet to
false . |
void |
clear(long bitIndex)
Sets the bit specified by the index to
false . |
java.lang.Object |
clone()
Create a clone of this bit set, that is an instance of the same
class and contains the same elements.
|
boolean |
get(long bitIndex)
Returns the value of the bit with the specified index.
|
void |
set(int from,
int to)
Sets the bits between from (inclusive) and to (exclusive) to true.
|
void |
set(long bitIndex)
Sets the bit at the specified index to
true . |
long |
size()
Returns the number of bits of space actually in use by this
BitSet to represent bit values. |
public LongBitSet(long nbits)
0
through
nbits-1
. All bits are initially false
.nbits
- the initial size of the bit set.java.lang.NegativeArraySizeException
- if the specified initial size
is negative.public void clear(long bitIndex)
false
.bitIndex
- the index of the bit to be cleared.java.lang.IndexOutOfBoundsException
- if the specified index is negative.public void clear()
false
.public java.lang.Object clone()
clone
in class java.lang.Object
public boolean get(long bitIndex)
true
if the bit with the index bitIndex
is currently set in this BitSet
; otherwise, the result
is false
.bitIndex
- the bit index.java.lang.IndexOutOfBoundsException
- if the specified index is negative.public void set(long bitIndex)
true
.bitIndex
- a bit index.java.lang.IndexOutOfBoundsException
- if the specified index is negative.public void set(int from, int to)
from
- the start range (inclusive)to
- the end range (exclusive)java.lang.IndexOutOfBoundsException
- if from < 0 || from > topublic long size()
BitSet
to represent bit values.
The maximum element in the set is the size - 1st element.