C# Class System.Collections.BitArray

Inheritance: ICollection, ICloneable
显示文件 Open project: dotnet/corefx Class Usage Examples

Public Methods

Method Description
And ( BitArray value ) : BitArray
BitArray ( BitArray bits ) : System.Diagnostics
BitArray ( bool values ) : System.Diagnostics
BitArray ( byte bytes ) : System.Diagnostics
BitArray ( int length ) : System.Diagnostics
BitArray ( int length, bool defaultValue ) : System.Diagnostics
Clone ( ) : object
CopyTo ( Array array, int index ) : void
Get ( int index ) : bool
GetEnumerator ( ) : IEnumerator
Not ( ) : BitArray
Or ( BitArray value ) : BitArray
Set ( int index, bool value ) : void
SetAll ( bool value ) : void
Xor ( BitArray value ) : BitArray
this ( int index ) : bool

Private Methods

Method Description
BitArray ( ) : System.Diagnostics
GetArrayLength ( int n, int div ) : int

Used for conversion between different representations of bit array. Returns (n+(div-1))/div, rearranged to avoid arithmetic overflow. For example, in the bit to int case, the straightforward calc would be (n+31)/32, but that would cause overflow. So instead it's rearranged to ((n-1)/32) + 1, with special casing for 0. Usage: GetArrayLength(77, BitsPerInt32): returns how many ints must be allocated to store 77 bits.

Method Details

And() public method

public And ( BitArray value ) : BitArray
value BitArray
return BitArray

BitArray() public method

public BitArray ( BitArray bits ) : System.Diagnostics
bits BitArray
return System.Diagnostics

BitArray() public method

public BitArray ( bool values ) : System.Diagnostics
values bool
return System.Diagnostics

BitArray() public method

public BitArray ( byte bytes ) : System.Diagnostics
bytes byte
return System.Diagnostics

BitArray() public method

public BitArray ( int length ) : System.Diagnostics
length int
return System.Diagnostics

BitArray() public method

public BitArray ( int length, bool defaultValue ) : System.Diagnostics
length int
defaultValue bool
return System.Diagnostics

Clone() public method

public Clone ( ) : object
return object

CopyTo() public method

public CopyTo ( Array array, int index ) : void
array Array
index int
return void

Get() public method

public Get ( int index ) : bool
index int
return bool

GetEnumerator() public method

public GetEnumerator ( ) : IEnumerator
return IEnumerator

Not() public method

public Not ( ) : BitArray
return BitArray

Or() public method

public Or ( BitArray value ) : BitArray
value BitArray
return BitArray

Set() public method

public Set ( int index, bool value ) : void
index int
value bool
return void

SetAll() public method

public SetAll ( bool value ) : void
value bool
return void

Xor() public method

public Xor ( BitArray value ) : BitArray
value BitArray
return BitArray

this() public method

public this ( int index ) : bool
index int
return bool