Namespace

stat_qfsa

stat_qfsa

Quick finder in sorted array

Methods

static qfind(v, av, fCmp, fVal) → {number}

Quick finder in an array (dichotomic search algorithm)

Parameters:
Name Type Description
v object

Object to find

av array

Sorted array of object

fCmp function

Comparison function

fVal function

Value extraction function

Index of found object, -1 if not found

number

static stdCompare(s1, s2) → {number}

Standard Comparison function

Parameters:
Name Type Description
s1 object

First object to compare (array element)

s2 object

Second object to compare (searched value)

0 if equal, 1 if s1 after s2, -1 if s1 before s2

number

static strCompareCI(s1, s2) → {number}

String Comparison Case Insensitive

Parameters:
Name Type Description
s1 string

First string to compare (array element)

s2 string

Second string to compare (searched value)

0 if equal, 1 if s1 after s2, -1 if s1 before s2

number

static strCompareICI(s1, s2) → {number}

String Comparison Inverted, Case Insensitive

Parameters:
Name Type Description
s1 string

First string to compare (array element)

s2 string

Second string to compare (searched value)

0 if equal, 1 if s1 after s2, -1 if s1 before s2

number