Skip to main content

BitSet

Efficient bit storage and manipulation. See samples: https://public.datagrok.ai/js/samples/data-frame/aggregation

Constructors

new BitSet()

new BitSet(dart): BitSet

Creates a BitSet from the specified Dart object.

Parameters

ParameterType
dartany

Returns

BitSet

Source

src/dataframe/bit-set.ts:22

Properties

PropertyModifierType
dartpublicany

Accessors

anyFalse

get anyFalse(): boolean

Whether any bits are set to false.

Returns

boolean

Source

src/dataframe/bit-set.ts:84


anyTrue

get anyTrue(): boolean

Whether any bits are set to true.

Returns

boolean

Source

src/dataframe/bit-set.ts:81


falseCount

get falseCount(): number

Number of unset bits

Returns

number

Source

src/dataframe/bit-set.ts:76


length

get length(): number

Number of bits in a bitset

Returns

number

Source

src/dataframe/bit-set.ts:66


onChanged

get onChanged(): Observable<any>

Returns

Observable<any>

  • fires when the bitset gets changed.

Source

src/dataframe/bit-set.ts:203


trueCount

get trueCount(): number

Number of set bits

Returns

number

Source

src/dataframe/bit-set.ts:71


version

get version(): number

Version of the bitset

Returns

number

Source

src/dataframe/bit-set.ts:87

Methods

and()

and(other, notify): BitSet

Modifies this bitset by performing the bitwise AND operation against the specified bitset. Returns this.

Parameters

ParameterTypeDefault value
otherBitSetundefined
notifybooleantrue

Returns

BitSet

Source

src/dataframe/bit-set.ts:104


andNot()

andNot(other, notify): BitSet

Modifies this bitset by performing the bitwise AND_NOT operation against the specified bitset. Returns this.

Parameters

ParameterTypeDefault value
otherBitSetundefined
notifybooleantrue

Returns

BitSet

Source

src/dataframe/bit-set.ts:125


clone()

clone(): BitSet

Clones a bitset

Returns

BitSet

Source

src/dataframe/bit-set.ts:91


copyFrom()

copyFrom(b, notify): BitSet

Copies the content from the other BitSet.

Parameters

ParameterTypeDefault value
bBitSetundefined
notifybooleantrue

Returns

BitSet

Source

src/dataframe/bit-set.ts:193


findNext()

findNext(i, x): number

Finds the first index of value x, going forward from i-th position.

Parameters

ParameterTypeDescription
inumberindex
xboolean-

Returns

number

Source

src/dataframe/bit-set.ts:139


findPrev()

findPrev(i, x): number

Finds the first index of value x, going forward from i-th position, or -1 if not found.

Parameters

ParameterTypeDescription
inumberIndex to start searching from.
xbooleanValue to search for.

Returns

number

  • index of the first bit set to x, or -1 if not found

Source

src/dataframe/bit-set.ts:147


fireChanged()

fireChanged(): void

Returns

void

Source

src/dataframe/bit-set.ts:198


get()

get(i): boolean

Gets i-th bit

Parameters

ParameterType
inumber

Returns

boolean

Source

src/dataframe/bit-set.ts:152


getBuffer()

getBuffer(): Int32Array

Returns the underlying storage. Be careful with the direct manipulations, as some statistics (set count, etc) are cached.

Returns

Int32Array

Source

src/dataframe/bit-set.ts:56


getSelectedIndexes()

getSelectedIndexes(): Int32Array

Indexes of all set bits. The result is cached.

Returns

Int32Array

Source

src/dataframe/bit-set.ts:188


handleClick()

handleClick(rowIndexPredicate, mouseEvent, modifiedSelectOnly): void

Parameters

ParameterTypeDefault value
rowIndexPredicateIndexPredicateundefined
mouseEventMouseEventundefined
modifiedSelectOnlybooleanfalse

Returns

void

Source

src/dataframe/bit-set.ts:220


init()

init(f, notify): BitSet

Sets all bits by setting i-th bit to the results of f(i)

Parameters

ParameterTypeDefault valueDescription
fIndexPredicateundefinedfunction that accepts bit index and returns bit value
notifybooleantruewhether BitSet's changed event should be fired

Returns

BitSet

  • this

Source

src/dataframe/bit-set.ts:170


invert()

invert(notify): BitSet

Inverts a bitset.

Parameters

ParameterTypeDefault value
notifybooleantrue

Returns

BitSet

Source

src/dataframe/bit-set.ts:97


or()

or(other, notify): BitSet

Modifies this bitset by performing the bitwise OR operation against the specified bitset. Returns this.

Parameters

ParameterTypeDefault value
otherBitSetundefined
notifybooleantrue

Returns

BitSet

Source

src/dataframe/bit-set.ts:111


set()

set(i, x, notify): void

Sets i-th bit to x

Parameters

ParameterTypeDefault valueDescription
inumberundefined
xbooleanundefined
notifybooleantruewhether BitSet's changed event should be fired

Returns

void

Source

src/dataframe/bit-set.ts:161


setAll()

setAll(x, notify): BitSet

Sets all bits to x

Parameters

ParameterTypeDefault valueDescription
xbooleanundefined-
notifybooleantruewhether BitSet's changed event should be fired

Returns

BitSet

Source

src/dataframe/bit-set.ts:132


similarityTo()

similarityTo(b, metric): number

Finds the value of similarity between two BitSets.

Parameters

ParameterTypeDefault valueDescription
bBitSetundefinedsecond BitSet.
metric"tanimoto" | "dice" | "cosine" | "sokal" | "russel" | "rogot-goldberg" | "kulczynski" | "mc-connaughey" | "asymmetric" | "braun-blanquet"SIMILARITY_METRIC.TANIMOTOsimilarity metric to use.

Returns

number

  • similarity value

Source

src/dataframe/bit-set.ts:211


toBinaryString()

toBinaryString(): string

Returns

string

Source

src/dataframe/bit-set.ts:60


toString()

toString(): string

Returns

string

  • string representation of this bitset, like '0110'.

Source

src/dataframe/bit-set.ts:216


xor()

xor(other, notify): BitSet

Modifies this bitset by performing the bitwise XOR operation against the specified bitset. Returns this.

Parameters

ParameterTypeDefault value
otherBitSetundefined
notifybooleantrue

Returns

BitSet

Source

src/dataframe/bit-set.ts:118


create()

static create(length, f?): BitSet

Creates a BitSet of the specified length with all bits set to false.

Parameters

ParameterTypeDescription
lengthnumberNumber of bits.
f?null | IndexPredicatewhen specified, Sets all bits by setting i-th bit to the results of f(i)

Returns

BitSet

Source

src/dataframe/bit-set.ts:47


fromBytes()

static fromBytes(buffer, bitLength): BitSet

Creates a BitSet from the ArrayBuffer representing the bitset.

Parameters

ParameterTypeDescription
bufferArrayBufferAn array containing 1 and 0.
bitLengthnumbercount of bits.

Returns

BitSet

Source

src/dataframe/bit-set.ts:37


fromString()

static fromString(zerosOnes): BitSet

Creates a BitSet from the string representing the bitset.

Parameters

ParameterTypeDescription
zerosOnesstringA string containing '1' and '0'.

Returns

BitSet

Source

src/dataframe/bit-set.ts:29