type

BoolArray

src @Js
class BoolArray : Obj

Optimized fixed size array of booleans packed into words of 32-bits. The array values default to false.

constructors

make

Create a array of given size

methods

clear

Set entire array to false

copyFrom

Copy the booleans from that array into this array and return this.

eachTrue

Iterate each index set to true

fill

Fill this array with the given boolean value.

get

Get the boolean at the given index.

getAndSet

Set the value at given index and return the previous value.

set

Set the boolean at the given index.

size

Get number of booleans in the array

Slot Details

clear

src This clear()

Set entire array to false

copyFrom

src This copyFrom(BoolArray that)

Copy the booleans from that array into this array and return this.

eachTrue

src Void eachTrue(|Int| f)

Iterate each index set to true

fill

src This fill(Bool val, Range? range := null)

Fill this array with the given boolean value. If range is null then the entire array is filled, otherwise just the specified range. Return this.

get

src @Operator
Bool get(Int index)

Get the boolean at the given index. Negative indices are not supported.

getAndSet

src Bool getAndSet(Int index, Bool val)

Set the value at given index and return the previous value.

make

src static new make(Int size)

Create a array of given size

set

src @Operator
Void set(Int index, Bool val)

Set the boolean at the given index. Negative indices are not supported.

size

src Int size()

Get number of booleans in the array