<abstract> new AbstractSortArray( [interrupt])
Parameters:
| Name | Type | Argument | Default | Description |
|---|---|---|---|---|
interrupt |
module:sort/virtual.interruptCallback |
<optional> |
() => {} |
Throws:
-
-
Illegal constructor.
- Type
- TypeError
-
-
-
interruptmust be a function. - Type
- TypeError
-
Extends
Methods
-
delete(key)
-
Parameters:
Name Type Description key* Reference key of scoped variable.
- Inherited From:
- Implements:
Returns:
successful - Is
trueif removed,falseif element does not exist.- Type
- boolean
-
<generator> fill(factory [, length])
-
A method to interruptably populate the array with elements generated from
factory.Parameters:
Name Type Argument Default Description factorymodule:sort/virtual.fillCallback lengthnumber <optional>
this.length Throws:
-
factorymust be a function. - Type
- TypeError
-
-
get(key)
-
Parameters:
Name Type Description key* Reference key of scoped variable.
- Inherited From:
- Implements:
Returns:
value - Scoped variable for the given key or
undefinedif none exists.- Type
- *
-
has(key)
-
Parameters:
Name Type Description key* Reference key of scoped variable.
- Inherited From:
- Implements:
Returns:
exists - Instance contains a scoped variable for the given key.
- Type
- boolean
-
<generator> put(index, value)
-
A method to interruptably put an element in the array.
Parameters:
Name Type Description indexnumber Index to put element
value.value* Value to put in
index. -
set(key, value)
-
Parameters:
Name Type Description key* Reference key of scoped variable.
value* Value of scoped variable to set.
- Inherited From:
- Implements:
Returns:
- Type
- this
-
<generator> shuffle()
-
A method to interruptably randomize the order of elements in the array. Uses the Knuth Fisher Yates method.
-
slice( [begin] [, end])
-
Shallow copy a portion of an array into a new array object.
Parameters:
Name Type Argument Default Description beginnumber <optional>
0 First index of shallow copy.
endnumber <optional>
this.length Last index of shallow copy, not included.
- Inherited From:
Returns:
- Type
- Array
-
<generator, abstract> sort()
-
Abstract method to interruptably sort array of elements.
Throws:
-
Illegal invocation.
- Type
- TypeError
-
-
<generator> swap(i, j)
-
A method to interruptably swap two elements in the array.
Parameters:
Name Type Description inumber Index of first element to swap.
jnumber Index of second element to swap.