\Zxing\CommonBitArray

<p>A simple, fast array of bits, represented compactly by an array of ints internally.</p>

Summary

Methods
Properties
Constants
__construct()
getSize()
getSizeInBytes()
set()
flip()
getNextSet()
getNextUnset()
setBulk()
setRange()
clear()
isRange()
appendBits()
appendBit()
appendBitArray()
_xor()
toBytes()
get()
getBitArray()
reverse()
equals()
hashCode()
toString()
_clone()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
makeArray()
ensureCapacity()
$bits
$size
N/A

Properties

$bits

$bits

$size

$size

Methods

__construct()

__construct(mixed  $bits = [], mixed  $size) : mixed

Parameters

mixed $bits
mixed $size

Returns

mixed —

getSize()

getSize() : mixed

Returns

mixed —

getSizeInBytes()

getSizeInBytes() : mixed

Returns

mixed —

set()

set(mixed  $i) : mixed

Sets bit i.

Parameters

mixed $i

Returns

mixed —

flip()

flip(mixed  $i) : mixed

Flips bit i.

Parameters

mixed $i

Returns

mixed —

getNextSet()

getNextSet(mixed  $from) : \Zxing\Common\index

Parameters

mixed $from

Returns

\Zxing\Common\index —

of first bit that is set, starting from the given index, or size if none are set at or beyond this given index

getNextUnset()

getNextUnset(mixed  $from) : \Zxing\Common\index

Parameters

mixed $from

Returns

\Zxing\Common\index —

of next unset bit, or {@code size} if none are unset until the end

setBulk()

setBulk(mixed  $i, mixed  $newBits) : mixed

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

Parameters

mixed $i
mixed $newBits

Returns

mixed —

setRange()

setRange(mixed  $start, mixed  $end) : mixed

Sets a range of bits.

Parameters

mixed $start
mixed $end

Returns

mixed —

clear()

clear() : mixed

Clears all bits (sets to false).

Returns

mixed —

isRange()

isRange(mixed  $start, mixed  $end, mixed  $value) : true

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

Parameters

mixed $start
mixed $end
mixed $value

Throws

\Zxing\Common\InvalidArgumentException

if end is less than or equal to start

Returns

true —

iff all bits are set or not set in range, according to value argument

appendBits()

appendBits(mixed  $value, mixed  $numBits) : mixed

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.

Parameters

mixed $value
mixed $numBits

Returns

mixed —

appendBit()

appendBit(mixed  $bit) : mixed

Parameters

mixed $bit

Returns

mixed —

appendBitArray()

appendBitArray(mixed  $other) : mixed

Parameters

mixed $other

Returns

mixed —

_xor()

_xor(mixed  $other) : mixed

Parameters

mixed $other

Returns

mixed —

toBytes()

toBytes(mixed  $bitOffset, mixed  $array, mixed  $offset, mixed  $numBytes) : mixed

Parameters

mixed $bitOffset
mixed $array
mixed $offset
mixed $numBytes

Returns

mixed —

get()

get( $i) : true

Parameters

$i

; bit to get

Returns

true —

iff bit i is set

getBitArray()

getBitArray() : array

Returns

array —

underlying array of ints. The first element holds the first 32 bits, and the least significant bit is bit 0.

reverse()

reverse() : mixed

Reverses all bits in the array.

Returns

mixed —

equals()

equals(mixed  $o) : mixed

Parameters

mixed $o

Returns

mixed —

hashCode()

hashCode() : mixed

Returns

mixed —

toString()

toString() : mixed

Returns

mixed —

_clone()

_clone() : mixed

Returns

mixed —

makeArray()

makeArray(mixed  $size) : mixed

Parameters

mixed $size

Returns

mixed —

ensureCapacity()

ensureCapacity(mixed  $size) : mixed

Parameters

mixed $size

Returns

mixed —