C# Class ZXing.Common.BitArray

A simple, fast array of bits, represented compactly by an array of ints internally.
Mostrar archivo Open project: Redth/ZXing.Net.Mobile Class Usage Examples

Public Methods

Method Description
BitArray ( ) : System
BitArray ( int size ) : System
Clone ( ) : object

Erstellt ein neues Objekt, das eine Kopie der aktuellen Instanz darstellt.

Equals ( Object o ) : bool

Determines whether the specified System.Object is equal to this instance.

GetHashCode ( ) : int

Returns a hash code for this instance.

ToString ( ) : String

Returns a System.String that represents this instance.

appendBit ( bool bit ) : void

Appends the bit.

appendBitArray ( BitArray other ) : void
appendBits ( int value, int numBits ) : void

Appends the least-significant bits, from value, in order from most-significant to least-significant. For example, appending 6 bits from 0x000001E will append the bits 0, 1, 1, 1, 1, 0 in that order.

clear ( ) : void

Clears all bits (sets to false).

flip ( int i ) : void

Flips bit i.

getNextSet ( int from ) : int

Gets the next set.

getNextUnset ( int from ) : int

see getNextSet(int)

isRange ( int start, int end, bool value ) : bool

Efficient method to check if a range of bits is set, or not set.

reverse ( ) : void

Reverses all bits in the array.

setBulk ( int i, int newBits ) : void

Sets a block of 32 bits, starting at bit i.

setRange ( int start, int end ) : void

Sets a range of bits.

this ( int i ) : bool
toBytes ( int bitOffset, byte array, int offset, int numBytes ) : void

Toes the bytes.

xor ( BitArray other ) : void

Private Methods

Method Description
BitArray ( int bits, int size ) : System
ensureCapacity ( int size ) : void
makeArray ( int size ) : int[]
numberOfTrailingZeros ( int num ) : int

Method Details

BitArray() public method

public BitArray ( ) : System
return System

BitArray() public method

public BitArray ( int size ) : System
size int
return System

Clone() public method

Erstellt ein neues Objekt, das eine Kopie der aktuellen Instanz darstellt.
public Clone ( ) : object
return object

Equals() public method

Determines whether the specified System.Object is equal to this instance.
public Equals ( Object o ) : bool
o Object The to compare with this instance.
return bool

GetHashCode() public method

Returns a hash code for this instance.
public GetHashCode ( ) : int
return int

ToString() public method

Returns a System.String that represents this instance.
public ToString ( ) : String
return String

appendBit() public method

Appends the bit.
public appendBit ( bool bit ) : void
bit bool The bit.
return void

appendBitArray() public method

public appendBitArray ( BitArray other ) : void
other BitArray
return void

appendBits() public method

Appends the least-significant bits, from value, in order from most-significant to least-significant. For example, appending 6 bits from 0x000001E will append the bits 0, 1, 1, 1, 1, 0 in that order.
public appendBits ( int value, int numBits ) : void
value int containing bits to append
numBits int bits from value to append
return void

clear() public method

Clears all bits (sets to false).
public clear ( ) : void
return void

flip() public method

Flips bit i.
public flip ( int i ) : void
i int bit to set ///
return void

getNextSet() public method

Gets the next set.
public getNextSet ( int from ) : int
from int first bit to check
return int

getNextUnset() public method

see getNextSet(int)
public getNextUnset ( int from ) : int
from int index to start looking for unset bit
return int

isRange() public method

Efficient method to check if a range of bits is set, or not set.
public isRange ( int start, int end, bool value ) : bool
start int start of range, inclusive. ///
end int end of range, exclusive ///
value bool if true, checks that bits in range are set, otherwise checks that they are not set ///
return bool

reverse() public method

Reverses all bits in the array.
public reverse ( ) : void
return void

setBulk() public method

Sets a block of 32 bits, starting at bit i.
public setBulk ( int i, int newBits ) : void
i int first bit to set ///
newBits int the new value of the next 32 bits. Note again that the least-significant bit /// corresponds to bit i, the next-least-significant to i+1, and so on. ///
return void

setRange() public method

Sets a range of bits.
public setRange ( int start, int end ) : void
start int start of range, inclusive.
end int end of range, exclusive
return void

this() public method

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

toBytes() public method

Toes the bytes.
public toBytes ( int bitOffset, byte array, int offset, int numBytes ) : void
bitOffset int first bit to start writing
array byte array to write into. Bytes are written most-significant byte first. This is the opposite /// of the internal representation, which is exposed by BitArray
offset int position in array to start writing
numBytes int how many bytes to write
return void

xor() public method

public xor ( BitArray other ) : void
other BitArray
return void