Module: sort/virtual

Virtual module. Used to reference virtual interfaces and callbacks.

Classes

Entry

Type Definitions


compareCallback(a, b)

Invoked during each compare step of the ComparativeSortArray sort method.

Parameters:
Name Type Description
a *

An element to compare on the left-hand side.

b *

An element to compare on the right-hand side.

Returns:

result - See compareFunction

Type
number

fillCallback()

Invoked for each index to generate an element of the array.

Returns:

element - A generated value with which to populate the array.

Type
*

interruptCallback(step)

Invoked during each interruptable step of AbstractSortArray methods.

Parameters:
Name Type Description
step Object

An object containing information about a generic step interruption.

Properties
Name Type Description
type string

The type of step, e.g. "compare", "swap", "put", "key".

entries Array.<module:sort/virtual.Entry>

An array of index / value pairs of elements involved in the step.


keyCallback(o)

Invoked during each key step of the KeyedSortArray sort method.

Parameters:
Name Type Description
o *

An element whose non-negative integer value to check.

Returns:

result - A non-negative integer value representing the relational index of o.

Type
number

sequenceCallback(index)

Parameters:
Name Type Description
index number
Returns:

gapSize

Type
number