| java.lang.Object org.apache.lucene.util.BitVector
BitVector | final public class BitVector (Code) | | Optimized implementation of a vector of bits. This is more-or-less like
java.util.BitSet, but also includes the following:
- a count() method, which efficiently computes the number of one bits;
- optimized read from and write to disk;
- inlinable get() method;
- store and load, as bit set or d-gaps, depending on sparseness;
version: $Id: BitVector.java 564236 2007-08-09 15:21:19Z gsingers $ |
Method Summary | |
final public void | clear(int bit) Sets the value of bit to zero. | final public int | count() Returns the total number of one bits in this vector. | final public boolean | get(int bit) Returns true if bit is one and
false if it is zero. | final public void | set(int bit) Sets the value of bit to one. | final public int | size() Returns the number of bits in this vector. | final public void | write(Directory d, String name) Writes this vector to the file name in Directory
d , in a format that can be read by the constructor
BitVector.BitVector(Directory,String) . |
BitVector | public BitVector(int n)(Code) | | Constructs a vector capable of holding n bits.
|
clear | final public void clear(int bit)(Code) | | Sets the value of bit to zero.
|
count | final public int count()(Code) | | 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.
|
get | final public boolean get(int bit)(Code) | | Returns true if bit is one and
false if it is zero.
|
set | final public void set(int bit)(Code) | | Sets the value of bit to one.
|
size | final public int size()(Code) | | Returns the number of bits in this vector. This is also one greater than
the number of the largest valid bit number.
|
|
|