java.lang.Object | |
↳ | org.apache.lucene.util.BitVector |
Optimized implementation of a vector of bits. This is more-or-less like java.util.BitSet, but also includes the following:
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs a vector capable of holding
n bits. | |||||||||||
Constructs a bit vector from the file
name in Directory
d , as written by the write(Directory, String) method. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Sets the value of
bit to zero. | |||||||||||
Returns the total number of one bits in this vector.
| |||||||||||
Returns
true if bit is one and
false if it is zero. | |||||||||||
Sets the value of
bit to true, and
returns true if bit was already set | |||||||||||
For testing
| |||||||||||
Sets the value of
bit to one. | |||||||||||
Returns the number of bits in this vector.
| |||||||||||
Retrieve a subset of this BitVector.
| |||||||||||
Writes this vector to the file
name in Directory
d , in a format that can be read by the constructor BitVector(Directory, String) . |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Constructs a vector capable of holding n
bits.
Constructs a bit vector from the file name
in Directory
d
, as written by the write(Directory, String)
method.
IOException |
---|
Sets the value of bit
to zero.
Returns the total number of one bits in this vector. This is efficiently computed and cached, so that, if the vector is not changed, no recomputation is done for repeated calls.
Returns true
if bit
is one and
false
if it is zero.
Sets the value of bit
to true, and
returns true if bit was already set
For testing
Sets the value of bit
to one.
Returns the number of bits in this vector. This is also one greater than the number of the largest valid bit number.
Retrieve a subset of this BitVector.
start | starting index, inclusive |
---|---|
end | ending index, exclusive |
Writes this vector to the file name
in Directory
d
, in a format that can be read by the constructor BitVector(Directory, String)
.
IOException |
---|