Lucene.Net  3.0.3
Lucene.Net is a .NET port of the Java Lucene Indexing Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties
Public Member Functions | List of all members
Lucene.Net.Util.BitVector Class Reference

Optimized implementation of a vector of bits. This is more-or-less like java.util.BitSet, but also includes the following:

More...

Inherits ICloneable.

Public Member Functions

 BitVector (int n)
 Constructs a vector capable of holding n bits.
 
System.Object Clone ()
 
void Set (int bit)
 Sets the value of bit to one.
 
bool GetAndSet (int bit)
 Sets the value of bit to true, and returns true if bit was already set
 
void Clear (int bit)
 Sets the value of bit to zero.
 
bool Get (int bit)
 Returns true if bit is one and false if it is zero.
 
int Size ()
 Returns the number of bits in this vector. This is also one greater than the number of the largest valid bit number.
 
int Count ()
 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.
 
int GetRecomputedCount ()
 For testing
 
void Write (Directory d, System.String name)
 Writes this vector to the file name in Directory d, in a format that can be read by the constructor BitVector(Directory, String).
 
 BitVector (Directory d, System.String name)
 Constructs a bit vector from the file name in Directory d, as written by the Write method.
 
BitVector Subset (int start, int end)
 Retrieve a subset of this BitVector.
 

Detailed Description

Optimized implementation of a vector of bits. This is more-or-less like java.util.BitSet, but also includes the following:

Definition at line 36 of file BitVector.cs.

Constructor & Destructor Documentation

Lucene.Net.Util.BitVector.BitVector ( int  n)

Constructs a vector capable of holding n bits.

Definition at line 44 of file BitVector.cs.

Lucene.Net.Util.BitVector.BitVector ( Directory  d,
System.String  name 
)

Constructs a bit vector from the file name in Directory d, as written by the Write method.

Definition at line 241 of file BitVector.cs.

Member Function Documentation

void Lucene.Net.Util.BitVector.Clear ( int  bit)

Sets the value of bit to zero.

Definition at line 102 of file BitVector.cs.

System.Object Lucene.Net.Util.BitVector.Clone ( )

Definition at line 58 of file BitVector.cs.

int Lucene.Net.Util.BitVector.Count ( )

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.

Definition at line 133 of file BitVector.cs.

bool Lucene.Net.Util.BitVector.Get ( int  bit)

Returns true if bit is one and false if it is zero.

Definition at line 115 of file BitVector.cs.

bool Lucene.Net.Util.BitVector.GetAndSet ( int  bit)

Sets the value of bit to true, and returns true if bit was already set

Definition at line 81 of file BitVector.cs.

int Lucene.Net.Util.BitVector.GetRecomputedCount ( )

For testing

Definition at line 151 of file BitVector.cs.

void Lucene.Net.Util.BitVector.Set ( int  bit)

Sets the value of bit to one.

Definition at line 68 of file BitVector.cs.

int Lucene.Net.Util.BitVector.Size ( )

Returns the number of bits in this vector. This is also one greater than the number of the largest valid bit number.

Definition at line 124 of file BitVector.cs.

BitVector Lucene.Net.Util.BitVector.Subset ( int  start,
int  end 
)

Retrieve a subset of this BitVector.

Parameters
startstarting index, inclusive
endending index, exclusive
Returns
subset

Definition at line 295 of file BitVector.cs.

void Lucene.Net.Util.BitVector.Write ( Directory  d,
System.String  name 
)

Writes this vector to the file name in Directory d, in a format that can be read by the constructor BitVector(Directory, String).

Definition at line 167 of file BitVector.cs.


The documentation for this class was generated from the following file: