C# 클래스 GSF.Collections.BitArray

Provides an array of bits. Much like the native .NET implementation, however this focuses on providing a free space bit array.
파일 보기 프로젝트 열기: GridProtectionAlliance/openHistorian 1 사용 예제들

공개 메소드들

메소드 설명
AreAllBitsCleared ( int index, int length ) : bool

Determines if any of the provided bits are cleared.

AreAllBitsSet ( int index, int length ) : bool

Determines if any of the provided bits are set.

BitArray ( bool initialState, int count = BitsPerElement ) : System

Initializes BitArray.

ClearAll ( ) : void

Clears all bits.

ClearBit ( int index ) : void

Sets the corresponding bit to false

ClearBits ( int index, int length ) : void

Clears a series of bits

EnsureCapacity ( int capacity ) : void

Verifies that the BitArray has the capacity to store the provided number of elements. If not, the bit array will autogrow by a factor of 2 or at least the capacity

FindClearedBit ( ) : int

Returns the index of the first bit that is cleared. -1 is returned if all bits are set.

FindSetBit ( ) : int

Returns the index of the first bit that is set. -1 is returned if all bits are set.

GetAllClearedBits ( ) : IEnumerable

Yields a list of all bits that are cleared.

GetAllSetBits ( ) : IEnumerable

Yields a list of all bits that are set.

GetBit ( int index ) : bool

Gets the status of the corresponding bit.

SetAll ( ) : void

Sets all bits.

SetBit ( int index ) : void

Sets the corresponding bit to true

SetBits ( int index, int length ) : void

Sets a series of bits

SetCapacity ( int capacity ) : void

Increases the capacity of the bit array. Decreasing capacity is currently not supported

TryClearBit ( int index ) : bool

Sets the corresponding bit to false. Returns true if the bit state was changed.

True if the bit state was changed. False if the bit was already cleared.

TrySetBit ( int index ) : bool

Sets the corresponding bit to true. Returns true if the bit state was changed.

True if the bit state was changed. False if the bit was already set.

this ( int index ) : bool

Gets/Sets individual bits in this array.

비공개 메소드들

메소드 설명
GetBitUnchecked ( int index ) : bool
ThrowException ( int index ) : void
ThrowException ( int index, int length ) : void
Validate ( int index ) : void
Validate ( int index, int length ) : void

메소드 상세

AreAllBitsCleared() 공개 메소드

Determines if any of the provided bits are cleared.
public AreAllBitsCleared ( int index, int length ) : bool
index int the starting index
length int the length of the run
리턴 bool

AreAllBitsSet() 공개 메소드

Determines if any of the provided bits are set.
public AreAllBitsSet ( int index, int length ) : bool
index int the starting index
length int the length of the run
리턴 bool

BitArray() 공개 메소드

Initializes BitArray.
public BitArray ( bool initialState, int count = BitsPerElement ) : System
initialState bool Set to true to initial will all elements set. False to have all elements cleared.
count int The number of bit positions to support
리턴 System

ClearAll() 공개 메소드

Clears all bits.
public ClearAll ( ) : void
리턴 void

ClearBit() 공개 메소드

Sets the corresponding bit to false
public ClearBit ( int index ) : void
index int
리턴 void

ClearBits() 공개 메소드

Clears a series of bits
public ClearBits ( int index, int length ) : void
index int the starting index to clear
length int the length of bits
리턴 void

EnsureCapacity() 공개 메소드

Verifies that the BitArray has the capacity to store the provided number of elements. If not, the bit array will autogrow by a factor of 2 or at least the capacity
public EnsureCapacity ( int capacity ) : void
capacity int
리턴 void

FindClearedBit() 공개 메소드

Returns the index of the first bit that is cleared. -1 is returned if all bits are set.
public FindClearedBit ( ) : int
리턴 int

FindSetBit() 공개 메소드

Returns the index of the first bit that is set. -1 is returned if all bits are set.
public FindSetBit ( ) : int
리턴 int

GetAllClearedBits() 공개 메소드

Yields a list of all bits that are cleared.
public GetAllClearedBits ( ) : IEnumerable
리턴 IEnumerable

GetAllSetBits() 공개 메소드

Yields a list of all bits that are set.
public GetAllSetBits ( ) : IEnumerable
리턴 IEnumerable

GetBit() 공개 메소드

Gets the status of the corresponding bit.
public GetBit ( int index ) : bool
index int
리턴 bool

SetAll() 공개 메소드

Sets all bits.
public SetAll ( ) : void
리턴 void

SetBit() 공개 메소드

Sets the corresponding bit to true
public SetBit ( int index ) : void
index int
리턴 void

SetBits() 공개 메소드

Sets a series of bits
public SetBits ( int index, int length ) : void
index int the starting index to clear
length int the length of bits
리턴 void

SetCapacity() 공개 메소드

Increases the capacity of the bit array. Decreasing capacity is currently not supported
public SetCapacity ( int capacity ) : void
capacity int the number of bits to support
리턴 void

TryClearBit() 공개 메소드

Sets the corresponding bit to false. Returns true if the bit state was changed.
True if the bit state was changed. False if the bit was already cleared.
public TryClearBit ( int index ) : bool
index int
리턴 bool

TrySetBit() 공개 메소드

Sets the corresponding bit to true. Returns true if the bit state was changed.
True if the bit state was changed. False if the bit was already set.
public TrySetBit ( int index ) : bool
index int
리턴 bool

this() 공개 메소드

Gets/Sets individual bits in this array.
public this ( int index ) : bool
index int the bit position to get.
리턴 bool