BiSort

Collection of static functions used for sorting and comparing

This class extends BiObject and therefore all methods and fields available for BiObject are also available for BiSort .

Constructor

new BiSort ( )

Parameters

No parameters.

Properties

None.

Methods

None.

Events

None.

Static Methods

NameDescription
caseInsensitiveStringCompareA function taking two strings and returns a number used to compare them (less than zero if first is smaller, zero if equal and otherwise larger than zero). This comparison is case insensitive.
dateCompareA function taking two Date objects and returns a number used to compare them (less than zero if first is smaller, zero if equal and otherwise larger than zero).
lessThanCompareA function taking two objects and uses the built in less than operator to compare them and returns a number (less than zero if first is smaller, zero if equal and otherwise larger than zero).
numberCompareA function taking two number arguments and returns a number used to compare them (less than zero if first is smaller, zero if equal and otherwise larger than zero).
stringCompareA function taking two strings and returns a number used to compare them (less than zero if first is smaller, zero if equal and otherwise larger than zero).

Static Fields

None.

Remarks

None.

Static Method Details

caseInsensitiveStringCompare

A function taking two strings and returns a number used to compare them (less than zero if first is smaller, zero if equal and otherwise larger than zero). This comparison is case insensitive.

Syntax

BiSort . caseInsensitiveStringCompare ( s1,s2 )

Parameters

NameTypeOptionalDefaultDescripton
s1StringThe first string
s2StringThe second string

Return Type

Number

dateCompare

A function taking two Date objects and returns a number used to compare them (less than zero if first is smaller, zero if equal and otherwise larger than zero).

Syntax

BiSort . dateCompare ( d1,d2 )

Parameters

NameTypeOptionalDefaultDescripton
d1DateThe first date
d2DateThe second date

Return Type

Number

lessThanCompare

A function taking two objects and uses the built in less than operator to compare them and returns a number (less than zero if first is smaller, zero if equal and otherwise larger than zero).

Syntax

BiSort . lessThanCompare ( v1,v2 )

Parameters

NameTypeOptionalDefaultDescripton
v1ObjectThe first value
v2ObjectThe second value

Return Type

Number

numberCompare

A function taking two number arguments and returns a number used to compare them (less than zero if first is smaller, zero if equal and otherwise larger than zero).

Syntax

BiSort . numberCompare ( n1,n2 )

Parameters

NameTypeOptionalDefaultDescripton
n1NumberThe first number
n2NumberThe second number

Return Type

Number

stringCompare

A function taking two strings and returns a number used to compare them (less than zero if first is smaller, zero if equal and otherwise larger than zero).

Syntax

BiSort . stringCompare ( s1,s2 )

Parameters

NameTypeOptionalDefaultDescripton
s1StringThe first string
s2StringThe second string

Return Type

Number