Class ImmutableBitSet
- Namespace
- BelNytheraSeiche.TrieDictionary
- Assembly
- BelNytheraSeiche.TrieDictionary.dll
Represents a read-only, immutable bit set.
public class ImmutableBitSet
- Inheritance
-
ImmutableBitSet
- Derived
- Inherited Members
Constructors
ImmutableBitSet(ulong[], int)
Represents a read-only, immutable bit set.
public ImmutableBitSet(ulong[] buffer, int count)
Parameters
buffer
ulong[]The underlying ulong array that stores the bits.
count
intThe total number of bits in the set.
Properties
Buffer
Gets the underlying ulong array that stores the bits.
public ulong[] Buffer { get; }
Property Value
- ulong[]
Count
Gets the total number of bits in the set.
public int Count { get; }
Property Value
this[int]
Gets the bit value at the specified index.
public bool this[int index] { get; }
Parameters
index
intThe zero-based index of the bit to get.
Property Value
- bool
The bit value (
true
for 1,false
for 0).
Exceptions
- ArgumentOutOfRangeException
index
is out of range.
Methods
At(int)
Gets the bit value at the specified index.
public bool At(int index)
Parameters
index
intThe zero-based index of the bit to get.
Returns
- bool
The bit value (
true
for 1,false
for 0).
ToRankSelect(ImmutableBitSet, bool)
Creates a new RankSelectBitSet from the specified ImmutableBitSet.
public static RankSelectBitSet ToRankSelect(ImmutableBitSet bitSet, bool createAuxDir = true)
Parameters
bitSet
ImmutableBitSetThe source immutable bit set to convert.
createAuxDir
boolA value indicating whether to immediately create the auxiliary directories required for fast Rank and Select operations.
Returns
- RankSelectBitSet
A new RankSelectBitSet instance.
Remarks
If createAuxDir
is set to false
, this method is very fast, but the returned
RankSelectBitSet will not be ready for Rank/Select operations until its auxiliary directories
are created and set via the SetAuxDir()
method.
If set to true
(the default), the auxiliary directories are created during this call, which takes more processing time
but results in a fully initialized and ready-to-use object.
Exceptions
- ArgumentNullException
bitSet
is null.
ToRankSelect(bool)
Creates a new RankSelectBitSet from the specified ImmutableBitSet.
public RankSelectBitSet ToRankSelect(bool createAuxDir = true)
Parameters
createAuxDir
boolA value indicating whether to immediately create the auxiliary directories required for fast Rank and Select operations.
Returns
- RankSelectBitSet
A new RankSelectBitSet instance.
Remarks
If createAuxDir
is set to false
, this method is very fast, but the returned
RankSelectBitSet will not be ready for Rank/Select operations until its auxiliary directories
are created and set via the SetAuxDir()
method.
If set to true
(the default), the auxiliary directories are created during this call, which takes more processing time
but results in a fully initialized and ready-to-use object.