Class FixedBitSet
BitSet of fixed length (numBits), backed by accessible (GetBits())
long[], accessed with an int index, implementing GetBits() and
DocIdSet. If you need to manage more than 2.1B bits, use
Int64BitSet.
This is a Lucene.NET INTERNAL API, use at your own risk
Inheritance
System.Object
FixedBitSet
Inherited Members
System.Object.Equals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: Lucene.Net.dll
Syntax
public sealed class FixedBitSet : DocIdSet, IBits
Constructors
|
Improve this Doc
View Source
FixedBitSet(Int32)
Declaration
public FixedBitSet(int numBits)
Parameters
Type |
Name |
Description |
System.Int32 |
numBits |
|
|
Improve this Doc
View Source
FixedBitSet(Int64[], Int32)
Declaration
public FixedBitSet(long[] storedBits, int numBits)
Parameters
Type |
Name |
Description |
System.Int64[] |
storedBits |
|
System.Int32 |
numBits |
|
Properties
|
Improve this Doc
View Source
Bits
Declaration
public override IBits Bits { get; }
Property Value
Overrides
|
Improve this Doc
View Source
IsCacheable
This DocIdSet implementation is cacheable.
Declaration
public override bool IsCacheable { get; }
Property Value
Type |
Description |
System.Boolean |
|
Overrides
|
Improve this Doc
View Source
Length
Declaration
public int Length { get; }
Property Value
Type |
Description |
System.Int32 |
|
Methods
|
Improve this Doc
View Source
And(DocIdSetIterator)
Does in-place AND of the bits provided by the
iterator.
Declaration
public void And(DocIdSetIterator iter)
Parameters
|
Improve this Doc
View Source
And(FixedBitSet)
Declaration
public void And(FixedBitSet other)
Parameters
|
Improve this Doc
View Source
AndNot(DocIdSetIterator)
Does in-place AND NOT of the bits provided by the
iterator.
Declaration
public void AndNot(DocIdSetIterator iter)
Parameters
|
Improve this Doc
View Source
AndNot(FixedBitSet)
this = this AND NOT other
Declaration
public void AndNot(FixedBitSet other)
Parameters
|
Improve this Doc
View Source
AndNotCount(FixedBitSet, FixedBitSet)
Returns the popcount or cardinality of "a and not b" or
"intersection(a, not(b))". Neither set is modified.
Declaration
public static long AndNotCount(FixedBitSet a, FixedBitSet b)
Parameters
Returns
Type |
Description |
System.Int64 |
|
|
Improve this Doc
View Source
Bits2words(Int32)
Returns the number of 64 bit words it would take to hold numBits
Declaration
public static int Bits2words(int numBits)
Parameters
Type |
Name |
Description |
System.Int32 |
numBits |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Cardinality()
Returns number of set bits. NOTE: this visits every
System.Int64 in the backing bits array, and the result is not
internally cached!
Declaration
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Clear(Int32)
Declaration
public void Clear(int index)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
|
Improve this Doc
View Source
Clear(Int32, Int32)
Declaration
public void Clear(int startIndex, int endIndex)
Parameters
Type |
Name |
Description |
System.Int32 |
startIndex |
Lower index
|
System.Int32 |
endIndex |
One-past the last bit to clear
|
|
Improve this Doc
View Source
Clone()
Declaration
public FixedBitSet Clone()
Returns
|
Improve this Doc
View Source
EnsureCapacity(FixedBitSet, Int32)
If the given FixedBitSet is large enough to hold numBits
,
returns the given bits, otherwise returns a new FixedBitSet which
can hold the requested number of bits.
NOTE: the returned bitset reuses the underlying long[] of
the given bits
if possible. Also, calling Length on the
returned bits may return a value greater than numBits
.
Declaration
public static FixedBitSet EnsureCapacity(FixedBitSet bits, int numBits)
Parameters
Type |
Name |
Description |
FixedBitSet |
bits |
|
System.Int32 |
numBits |
|
Returns
|
Improve this Doc
View Source
Equals(Object)
Returns true
if both sets have the same bits set
Declaration
public override bool Equals(object o)
Parameters
Type |
Name |
Description |
System.Object |
o |
|
Returns
Type |
Description |
System.Boolean |
|
Overrides
System.Object.Equals(System.Object)
|
Improve this Doc
View Source
Flip(Int32, Int32)
Declaration
public void Flip(int startIndex, int endIndex)
Parameters
Type |
Name |
Description |
System.Int32 |
startIndex |
Lower index
|
System.Int32 |
endIndex |
One-past the last bit to flip
|
|
Improve this Doc
View Source
Get(Int32)
Declaration
public bool Get(int index)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
GetAndClear(Int32)
Declaration
public bool GetAndClear(int index)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
GetAndSet(Int32)
Declaration
public bool GetAndSet(int index)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
GetBits()
Declaration
Returns
Type |
Description |
System.Int64[] |
|
|
Improve this Doc
View Source
GetHashCode()
Declaration
public override int GetHashCode()
Returns
Type |
Description |
System.Int32 |
|
Overrides
System.Object.GetHashCode()
|
Improve this Doc
View Source
GetIterator()
Declaration
public override DocIdSetIterator GetIterator()
Returns
Overrides
|
Improve this Doc
View Source
IntersectionCount(FixedBitSet, FixedBitSet)
Returns the popcount or cardinality of the intersection of the two sets.
Neither set is modified.
Declaration
public static long IntersectionCount(FixedBitSet a, FixedBitSet b)
Parameters
Returns
Type |
Description |
System.Int64 |
|
|
Improve this Doc
View Source
Intersects(FixedBitSet)
Returns true if the sets have any elements in common
Declaration
public bool Intersects(FixedBitSet other)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
NextSetBit(Int32)
Returns the index of the first set bit starting at the index specified.
-1 is returned if there are no more set bits.
Declaration
public int NextSetBit(int index)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Or(DocIdSetIterator)
Does in-place OR of the bits provided by the
iterator.
Declaration
public void Or(DocIdSetIterator iter)
Parameters
|
Improve this Doc
View Source
Or(FixedBitSet)
Declaration
public void Or(FixedBitSet other)
Parameters
|
Improve this Doc
View Source
PrevSetBit(Int32)
Returns the index of the last set bit before or on the index specified.
-1 is returned if there are no more set bits.
Declaration
public int PrevSetBit(int index)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
Returns
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Set(Int32)
Declaration
public void Set(int index)
Parameters
Type |
Name |
Description |
System.Int32 |
index |
|
|
Improve this Doc
View Source
Set(Int32, Int32)
Declaration
public void Set(int startIndex, int endIndex)
Parameters
Type |
Name |
Description |
System.Int32 |
startIndex |
Lower index
|
System.Int32 |
endIndex |
One-past the last bit to set
|
|
Improve this Doc
View Source
UnionCount(FixedBitSet, FixedBitSet)
Returns the popcount or cardinality of the union of the two sets. Neither
set is modified.
Declaration
public static long UnionCount(FixedBitSet a, FixedBitSet b)
Parameters
Returns
Type |
Description |
System.Int64 |
|
|
Improve this Doc
View Source
Xor(DocIdSetIterator)
Does in-place XOR of the bits provided by the iterator.
Declaration
public void Xor(DocIdSetIterator iter)
Parameters
|
Improve this Doc
View Source
Xor(FixedBitSet)
Declaration
public void Xor(FixedBitSet other)
Parameters
Implements
Extension Methods