Class ScyllaBitArray.Builder
Fluent builder for constructing ScyllaBitArray instances with an optional synchronized wrapper.
Inherited Members
Namespace: Scylla.Core.Structures
Assembly: ScyllaCore.dll
Syntax
public sealed class ScyllaBitArray.Builder
Remarks
Use CreateBuilder() to obtain a new builder rather than constructing one directly. Call the configuration methods in any order and finalize with Build() (returns IScyllaCollection) or BuildConcrete() (returns the raw ScyllaBitArray when synchronization is not requested).
Methods
Build()
Constructs the configured bit array and returns it as an IScyllaCollection.
Declaration
public IScyllaCollection Build()
Returns
| Type | Description |
|---|---|
| IScyllaCollection | A ScyllaBitArray.SynchronizedScyllaBitArray if synchronization was requested; otherwise a ScyllaBitArray. |
Remarks
If Synchronized(object) was called, the returned value is a ScyllaBitArray.SynchronizedScyllaBitArray; otherwise it is a plain ScyllaBitArray. Both implement IScyllaCollection.
BuildConcrete()
Constructs and returns the concrete ScyllaBitArray instance without any wrapper.
Declaration
public ScyllaBitArray BuildConcrete()
Returns
| Type | Description |
|---|---|
| ScyllaBitArray | The configured ScyllaBitArray instance. |
Remarks
Use this method when the calling code needs access to the concrete type and its allocation-free ScyllaBitArray.Enumerator. This method fails if Synchronized(object) was previously called, because the concrete type cannot be returned through a synchronized wrapper.
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Thrown when Synchronized(object) was called, as a synchronized wrapper cannot be returned as a concrete ScyllaBitArray. Use Build() instead. |
Synchronized(object)
Configures the builder to wrap the produced array in a ScyllaBitArray.SynchronizedScyllaBitArray so that all operations are thread-safe.
Declaration
public ScyllaBitArray.Builder Synchronized(object syncRoot = null)
Parameters
| Type | Name | Description |
|---|---|---|
| object | syncRoot | An optional lock object shared with other collections. When |
Returns
| Type | Description |
|---|---|
| ScyllaBitArray.Builder | This builder instance for method chaining. |
WithCapacity(int)
Configures the bit capacity of the array to be built.
Declaration
public ScyllaBitArray.Builder WithCapacity(int capacity)
Parameters
| Type | Name | Description |
|---|---|---|
| int | capacity | The desired number of bits. Must be at least |
Returns
| Type | Description |
|---|---|
| ScyllaBitArray.Builder | This builder instance for method chaining. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentOutOfRangeException | Thrown when |