Class Int64BitSet
BitSet of fixed length (numBits), backed by accessible (GetBits()) long[], accessed with a long index. Use it only if you intend to store more than 2.1B bits, otherwise you should use FixedBitSet.
NOTE: This was LongBitSet in LuceneNote
This API is for internal purposes only and might change in incompatible ways in the next release.
Inherited Members
Namespace: Lucene.Net.Util
Assembly: Lucene.Net.dll
Syntax
[Serializable]
public sealed class Int64BitSet
Constructors
Int64BitSet(long)
BitSet of fixed length (numBits), backed by accessible (GetBits()) long[], accessed with a long index. Use it only if you intend to store more than 2.1B bits, otherwise you should use FixedBitSet.
NOTE: This was LongBitSet in LuceneNote
This API is for internal purposes only and might change in incompatible ways in the next release.
Declaration
public Int64BitSet(long numBits)
Parameters
Type | Name | Description |
---|---|---|
long | numBits |
Int64BitSet(long[], long)
BitSet of fixed length (numBits), backed by accessible (GetBits()) long[], accessed with a long index. Use it only if you intend to store more than 2.1B bits, otherwise you should use FixedBitSet.
NOTE: This was LongBitSet in LuceneNote
This API is for internal purposes only and might change in incompatible ways in the next release.
Declaration
public Int64BitSet(long[] storedBits, long numBits)
Parameters
Type | Name | Description |
---|---|---|
long[] | storedBits | |
long | numBits |
Properties
Cardinality
Gets the number of set bits. NOTE: this visits every long in the backing bits array, and the result is not internally cached!
Declaration
public long Cardinality { get; }
Property Value
Type | Description |
---|---|
long |
Length
Returns the number of bits stored in this bitset.
Declaration
public long Length { get; }
Property Value
Type | Description |
---|---|
long |
Methods
And(Int64BitSet)
this = this AND other
Declaration
public void And(Int64BitSet other)
Parameters
Type | Name | Description |
---|---|---|
Int64BitSet | other |
AndNot(Int64BitSet)
this = this AND NOT other
Declaration
public void AndNot(Int64BitSet other)
Parameters
Type | Name | Description |
---|---|---|
Int64BitSet | other |
Bits2words(long)
Returns the number of 64 bit words it would take to hold numBits
.
Declaration
public static int Bits2words(long numBits)
Parameters
Type | Name | Description |
---|---|---|
long | numBits |
Returns
Type | Description |
---|---|
int |
Clear(long)
BitSet of fixed length (numBits), backed by accessible (GetBits()) long[], accessed with a long index. Use it only if you intend to store more than 2.1B bits, otherwise you should use FixedBitSet.
NOTE: This was LongBitSet in LuceneNote
This API is for internal purposes only and might change in incompatible ways in the next release.
Declaration
public void Clear(long index)
Parameters
Type | Name | Description |
---|---|---|
long | index |
Clear(long, long)
Clears a range of bits.
Declaration
public void Clear(long startIndex, long endIndex)
Parameters
Type | Name | Description |
---|---|---|
long | startIndex | Lower index |
long | endIndex | One-past the last bit to clear |
Clone()
BitSet of fixed length (numBits), backed by accessible (GetBits()) long[], accessed with a long index. Use it only if you intend to store more than 2.1B bits, otherwise you should use FixedBitSet.
NOTE: This was LongBitSet in LuceneNote
This API is for internal purposes only and might change in incompatible ways in the next release.
Declaration
public Int64BitSet Clone()
Returns
Type | Description |
---|---|
Int64BitSet |
EnsureCapacity(Int64BitSet, long)
If the given Int64BitSet is large enough to hold
numBits
, returns the given bits
, otherwise returns a new
Int64BitSet which can hold the requested number of bits.
bits
if possible. Also, reading Length on the
returned bits may return a value greater than numBits
.
Declaration
public static Int64BitSet EnsureCapacity(Int64BitSet bits, long numBits)
Parameters
Type | Name | Description |
---|---|---|
Int64BitSet | bits | |
long | numBits |
Returns
Type | Description |
---|---|
Int64BitSet |
Equals(object)
Returns true
if both sets have the same bits set
Declaration
public override bool Equals(object o)
Parameters
Type | Name | Description |
---|---|---|
object | o |
Returns
Type | Description |
---|---|
bool |
Overrides
Flip(long, long)
Flips a range of bits
Declaration
public void Flip(long startIndex, long endIndex)
Parameters
Type | Name | Description |
---|---|---|
long | startIndex | Lower index |
long | endIndex | One-past the last bit to flip |
Get(long)
BitSet of fixed length (numBits), backed by accessible (GetBits()) long[], accessed with a long index. Use it only if you intend to store more than 2.1B bits, otherwise you should use FixedBitSet.
NOTE: This was LongBitSet in LuceneNote
This API is for internal purposes only and might change in incompatible ways in the next release.
Declaration
public bool Get(long index)
Parameters
Type | Name | Description |
---|---|---|
long | index |
Returns
Type | Description |
---|---|
bool |
GetAndClear(long)
BitSet of fixed length (numBits), backed by accessible (GetBits()) long[], accessed with a long index. Use it only if you intend to store more than 2.1B bits, otherwise you should use FixedBitSet.
NOTE: This was LongBitSet in LuceneNote
This API is for internal purposes only and might change in incompatible ways in the next release.
Declaration
public bool GetAndClear(long index)
Parameters
Type | Name | Description |
---|---|---|
long | index |
Returns
Type | Description |
---|---|
bool |
GetAndSet(long)
BitSet of fixed length (numBits), backed by accessible (GetBits()) long[], accessed with a long index. Use it only if you intend to store more than 2.1B bits, otherwise you should use FixedBitSet.
NOTE: This was LongBitSet in LuceneNote
This API is for internal purposes only and might change in incompatible ways in the next release.
Declaration
public bool GetAndSet(long index)
Parameters
Type | Name | Description |
---|---|---|
long | index |
Returns
Type | Description |
---|---|
bool |
GetBits()
Expert.
Declaration
public long[] GetBits()
Returns
Type | Description |
---|---|
long[] |
GetHashCode()
Serves as the default hash function.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | A hash code for the current object. |
Overrides
Intersects(Int64BitSet)
Returns true
if the sets have any elements in common
Declaration
public bool Intersects(Int64BitSet other)
Parameters
Type | Name | Description |
---|---|---|
Int64BitSet | other |
Returns
Type | Description |
---|---|
bool |
NextSetBit(long)
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 long NextSetBit(long index)
Parameters
Type | Name | Description |
---|---|---|
long | index |
Returns
Type | Description |
---|---|
long |
Or(Int64BitSet)
this = this OR other
Declaration
public void Or(Int64BitSet other)
Parameters
Type | Name | Description |
---|---|---|
Int64BitSet | other |
PrevSetBit(long)
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 long PrevSetBit(long index)
Parameters
Type | Name | Description |
---|---|---|
long | index |
Returns
Type | Description |
---|---|
long |
Set(long)
BitSet of fixed length (numBits), backed by accessible (GetBits()) long[], accessed with a long index. Use it only if you intend to store more than 2.1B bits, otherwise you should use FixedBitSet.
NOTE: This was LongBitSet in LuceneNote
This API is for internal purposes only and might change in incompatible ways in the next release.
Declaration
public void Set(long index)
Parameters
Type | Name | Description |
---|---|---|
long | index |
Set(long, long)
Sets a range of bits
Declaration
public void Set(long startIndex, long endIndex)
Parameters
Type | Name | Description |
---|---|---|
long | startIndex | Lower index |
long | endIndex | One-past the last bit to set |
Xor(Int64BitSet)
this = this XOR other
Declaration
public void Xor(Int64BitSet other)
Parameters
Type | Name | Description |
---|---|---|
Int64BitSet | other |