Manages a compact array of bit values, which are represented as Booleans, where true
indicates that the bit is on (1) and false
indicates the bit is off (0).
More...
|
| BitArray (int length) |
| Initializes a new instance of the T:System.Collections.BitArray class that can hold the specified number of bit values, which are initially set to false . More...
|
|
| BitArray (int length, bool defaultValue) |
| Initializes a new instance of the T:System.Collections.BitArray class that can hold the specified number of bit values, which are initially set to the specified value. More...
|
|
| BitArray (byte[] bytes) |
| Initializes a new instance of the T:System.Collections.BitArray class that contains bit values copied from the specified array of bytes. More...
|
|
| BitArray (bool[] values) |
| Initializes a new instance of the T:System.Collections.BitArray class that contains bit values copied from the specified array of Booleans. More...
|
|
| BitArray (int[] values) |
| Initializes a new instance of the T:System.Collections.BitArray class that contains bit values copied from the specified array of 32-bit integers. More...
|
|
| BitArray (BitArray bits) |
| Initializes a new instance of the T:System.Collections.BitArray class that contains bit values copied from the specified T:System.Collections.BitArray. More...
|
|
bool | Get (int index) |
| Gets the value of the bit at a specific position in the T:System.Collections.BitArray. More...
|
|
void | Set (int index, bool value) |
| Sets the bit at a specific position in the T:System.Collections.BitArray to the specified value. More...
|
|
void | SetAll (bool value) |
| Sets all bits in the T:System.Collections.BitArray to the specified value. More...
|
|
BitArray | And (BitArray value) |
| Performs the bitwise AND operation between the elements of the current T:System.Collections.BitArray object and the corresponding elements in the specified array. The current T:System.Collections.BitArray object will be modified to store the result of the bitwise AND operation. More...
|
|
BitArray | Or (BitArray value) |
| Performs the bitwise OR operation between the elements of the current T:System.Collections.BitArray object and the corresponding elements in the specified array. The current T:System.Collections.BitArray object will be modified to store the result of the bitwise OR operation. More...
|
|
BitArray | Xor (BitArray value) |
| Performs the bitwise exclusive OR operation between the elements of the current T:System.Collections.BitArray object against the corresponding elements in the specified array. The current T:System.Collections.BitArray object will be modified to store the result of the bitwise exclusive OR operation. More...
|
|
BitArray | Not () |
| Inverts all the bit values in the current T:System.Collections.BitArray, so that elements set to true are changed to false , and elements set to false are changed to true . More...
|
|
void | CopyTo (Array array, int index) |
| Copies the entire T:System.Collections.BitArray to a compatible one-dimensional T:System.Array, starting at the specified index of the target array. More...
|
|
object | Clone () |
| Creates a shallow copy of the T:System.Collections.BitArray. More...
|
|
IEnumerator | GetEnumerator () |
| Returns an enumerator that iterates through the T:System.Collections.BitArray. More...
|
|
|
int | Count => m_length |
| Gets the number of elements contained in the T:System.Collections.BitArray. More...
|
|
bool | IsReadOnly => false |
| Gets a value indicating whether the T:System.Collections.BitArray is read-only. More...
|
|
bool | IsSynchronized => false |
| Gets a value indicating whether access to the T:System.Collections.BitArray is synchronized (thread safe). More...
|
|
|
bool | this[int index] [get, set] |
| Gets or sets the value of the bit at a specific position in the T:System.Collections.BitArray. More...
|
|
int? | Length [get, set] |
| Gets or sets the number of elements in the T:System.Collections.BitArray. More...
|
|
object | SyncRoot [get] |
| Gets an object that can be used to synchronize access to the T:System.Collections.BitArray. More...
|
|
int | Count [get] |
| Gets the number of elements contained in the T:System.Collections.ICollection. More...
|
|
object | SyncRoot [get] |
| Gets an object that can be used to synchronize access to the T:System.Collections.ICollection. More...
|
|
bool | IsSynchronized [get] |
| Gets a value indicating whether access to the T:System.Collections.ICollection is synchronized (thread safe). More...
|
|
Manages a compact array of bit values, which are represented as Booleans, where true
indicates that the bit is on (1) and false
indicates the bit is off (0).
Definition at line 10 of file BitArray.cs.
◆ BitArray() [1/6]
System.Collections.BitArray.BitArray |
( |
int |
length | ) |
|
Initializes a new instance of the T:System.Collections.BitArray class that can hold the specified number of bit values, which are initially set to false
.
- Parameters
-
length | The number of bit values in the new T:System.Collections.BitArray. |
- Exceptions
-
T:System.ArgumentOutOfRangeException | length is less than zero. |
Definition at line 190 of file BitArray.cs.
◆ BitArray() [2/6]
System.Collections.BitArray.BitArray |
( |
int |
length, |
|
|
bool |
defaultValue |
|
) |
| |
Initializes a new instance of the T:System.Collections.BitArray class that can hold the specified number of bit values, which are initially set to the specified value.
- Parameters
-
length | The number of bit values in the new T:System.Collections.BitArray. |
defaultValue | The Boolean value to assign to each bit. |
- Exceptions
-
T:System.ArgumentOutOfRangeException | length is less than zero. |
Definition at line 201 of file BitArray.cs.
◆ BitArray() [3/6]
System.Collections.BitArray.BitArray |
( |
byte [] |
bytes | ) |
|
Initializes a new instance of the T:System.Collections.BitArray class that contains bit values copied from the specified array of bytes.
- Parameters
-
bytes | An array of bytes containing the values to copy, where each byte represents eight consecutive bits. |
- Exceptions
-
T:System.ArgumentNullException | bytes is null . |
T:System.ArgumentException | The length of bytes is greater than F:System.Int32.MaxValue. |
Definition at line 223 of file BitArray.cs.
◆ BitArray() [4/6]
System.Collections.BitArray.BitArray |
( |
bool [] |
values | ) |
|
Initializes a new instance of the T:System.Collections.BitArray class that contains bit values copied from the specified array of Booleans.
- Parameters
-
values | An array of Booleans to copy. |
- Exceptions
-
T:System.ArgumentNullException | values is null . |
Definition at line 261 of file BitArray.cs.
◆ BitArray() [5/6]
System.Collections.BitArray.BitArray |
( |
int [] |
values | ) |
|
Initializes a new instance of the T:System.Collections.BitArray class that contains bit values copied from the specified array of 32-bit integers.
- Parameters
-
values | An array of integers containing the values to copy, where each integer represents 32 consecutive bits. |
- Exceptions
-
T:System.ArgumentNullException | values is null . |
T:System.ArgumentException | The length of values is greater than F:System.Int32.MaxValue |
Definition at line 285 of file BitArray.cs.
◆ BitArray() [6/6]
System.Collections.BitArray.BitArray |
( |
BitArray |
bits | ) |
|
Initializes a new instance of the T:System.Collections.BitArray class that contains bit values copied from the specified T:System.Collections.BitArray.
- Parameters
-
bits | The T:System.Collections.BitArray to copy. |
- Exceptions
-
T:System.ArgumentNullException | bits is null . |
Definition at line 306 of file BitArray.cs.
◆ And()
Performs the bitwise AND operation between the elements of the current T:System.Collections.BitArray object and the corresponding elements in the specified array. The current T:System.Collections.BitArray object will be modified to store the result of the bitwise AND operation.
- Parameters
-
value | The array with which to perform the bitwise AND operation. |
- Returns
- An array containing the result of the bitwise AND operation, which is a reference to the current T:System.Collections.BitArray object.
- Exceptions
-
T:System.ArgumentNullException | value is null . |
T:System.ArgumentException | value and the current T:System.Collections.BitArray do not have the same number of elements. |
Definition at line 382 of file BitArray.cs.
◆ Clone()
object System.Collections.BitArray.Clone |
( |
| ) |
|
Creates a shallow copy of the T:System.Collections.BitArray.
- Returns
- A shallow copy of the T:System.Collections.BitArray.
Implements System.ICloneable.
Definition at line 532 of file BitArray.cs.
◆ CopyTo()
void System.Collections.BitArray.CopyTo |
( |
Array |
array, |
|
|
int |
index |
|
) |
| |
Copies the entire T:System.Collections.BitArray to a compatible one-dimensional T:System.Array, starting at the specified index of the target array.
- Parameters
-
array | The one-dimensional T:System.Array that is the destination of the elements copied from T:System.Collections.BitArray. The T:System.Array must have zero-based indexing. |
index | The zero-based index in array at which copying begins. |
- Exceptions
-
T:System.ArgumentNullException | array is null . |
T:System.ArgumentOutOfRangeException | index is less than zero. |
T:System.ArgumentException | array is multidimensional.-or- The number of elements in the source T:System.Collections.BitArray is greater than the available space from index to the end of the destination array . |
T:System.InvalidCastException | The type of the source T:System.Collections.BitArray cannot be cast automatically to the type of the destination array . |
Implements System.Collections.ICollection.
Definition at line 481 of file BitArray.cs.
◆ Get()
bool System.Collections.BitArray.Get |
( |
int |
index | ) |
|
Gets the value of the bit at a specific position in the T:System.Collections.BitArray.
- Parameters
-
index | The zero-based index of the value to get. |
- Returns
- The value of the bit at position index .
- Exceptions
-
T:System.ArgumentOutOfRangeException | index is less than zero.-or- index is greater than or equal to the number of elements in the T:System.Collections.BitArray. |
Definition at line 326 of file BitArray.cs.
◆ GetEnumerator()
IEnumerator System.Collections.BitArray.GetEnumerator |
( |
| ) |
|
Returns an enumerator that iterates through the T:System.Collections.BitArray.
- Returns
- An T:System.Collections.IEnumerator for the entire T:System.Collections.BitArray.
Implements System.Collections.IEnumerable.
Definition at line 543 of file BitArray.cs.
◆ Not()
BitArray System.Collections.BitArray.Not |
( |
| ) |
|
Inverts all the bit values in the current T:System.Collections.BitArray, so that elements set to true
are changed to false
, and elements set to false
are changed to true
.
- Returns
- The current instance with inverted bit values.
Definition at line 460 of file BitArray.cs.
◆ Or()
Performs the bitwise OR operation between the elements of the current T:System.Collections.BitArray object and the corresponding elements in the specified array. The current T:System.Collections.BitArray object will be modified to store the result of the bitwise OR operation.
- Parameters
-
value | The array with which to perform the bitwise OR operation. |
- Returns
- An array containing the result of the bitwise OR operation, which is a reference to the current T:System.Collections.BitArray object.
- Exceptions
-
T:System.ArgumentNullException | value is null . |
T:System.ArgumentException | value and the current T:System.Collections.BitArray do not have the same number of elements. |
Definition at line 410 of file BitArray.cs.
◆ Set()
void System.Collections.BitArray.Set |
( |
int |
index, |
|
|
bool |
value |
|
) |
| |
Sets the bit at a specific position in the T:System.Collections.BitArray to the specified value.
- Parameters
-
index | The zero-based index of the bit to set. |
value | The Boolean value to assign to the bit. |
- Exceptions
-
T:System.ArgumentOutOfRangeException | index is less than zero.-or- index is greater than or equal to the number of elements in the T:System.Collections.BitArray. |
Definition at line 342 of file BitArray.cs.
◆ SetAll()
void System.Collections.BitArray.SetAll |
( |
bool |
value | ) |
|
Sets all bits in the T:System.Collections.BitArray to the specified value.
- Parameters
-
value | The Boolean value to assign to all bits. |
Definition at line 362 of file BitArray.cs.
◆ Xor()
Performs the bitwise exclusive OR operation between the elements of the current T:System.Collections.BitArray object against the corresponding elements in the specified array. The current T:System.Collections.BitArray object will be modified to store the result of the bitwise exclusive OR operation.
- Parameters
-
value | The array with which to perform the bitwise exclusive OR operation. |
- Returns
- An array containing the result of the bitwise exclusive OR operation, which is a reference to the current T:System.Collections.BitArray object.
- Exceptions
-
T:System.ArgumentNullException | value is null . |
T:System.ArgumentException | value and the current T:System.Collections.BitArray do not have the same number of elements. |
Definition at line 438 of file BitArray.cs.
◆ Count
int System.Collections.BitArray.Count => m_length |
Gets the number of elements contained in the T:System.Collections.BitArray.
- Returns
- The number of elements contained in the T:System.Collections.BitArray.
Definition at line 157 of file BitArray.cs.
◆ IsReadOnly
bool System.Collections.BitArray.IsReadOnly => false |
Gets a value indicating whether the T:System.Collections.BitArray is read-only.
- Returns
- This property is always
false
.
Definition at line 175 of file BitArray.cs.
◆ IsSynchronized
bool System.Collections.BitArray.IsSynchronized => false |
Gets a value indicating whether access to the T:System.Collections.BitArray is synchronized (thread safe).
- Returns
- This property is always
false
.
Definition at line 179 of file BitArray.cs.
◆ Length
int? System.Collections.BitArray.Length |
|
getset |
Gets or sets the number of elements in the T:System.Collections.BitArray.
- Returns
- The number of elements in the T:System.Collections.BitArray.
- Exceptions
-
T:System.ArgumentOutOfRangeException | The property is set to a value that is less than zero. |
Definition at line 120 of file BitArray.cs.
◆ SyncRoot
object System.Collections.BitArray.SyncRoot |
|
get |
Gets an object that can be used to synchronize access to the T:System.Collections.BitArray.
- Returns
- An object that can be used to synchronize access to the T:System.Collections.BitArray.
Definition at line 162 of file BitArray.cs.
◆ this[int index]
bool System.Collections.BitArray.this[int index] |
|
getset |
Gets or sets the value of the bit at a specific position in the T:System.Collections.BitArray.
- Parameters
-
index | The zero-based index of the value to get or set. |
- Returns
- The value of the bit at position index .
- Exceptions
-
T:System.ArgumentOutOfRangeException | index is less than zero.-or- index is equal to or greater than P:System.Collections.BitArray.Count. |
Definition at line 102 of file BitArray.cs.
The documentation for this class was generated from the following file: