Array is collections of keys mapped to values. Array
has capabilities of list as it also retains doubly linked
list of its elements.
Constructor
Constructs array. Same as builtin [elements, ...] constructor.
| Parameters |
element -
If parameter is map, corresponding key and value are
added instead of map.
|
Methods
Append given value into this array.
| Returns |
this array modified |
Returns mapping at given index.
| Parameters |
index -
Index to array
|
Removess all mappings from this array.
| Returns |
this array cleared |
Appends value or values of array into this array.
| Returns |
this array modified |
Contract this array to containg only given range.
| Parameters |
start -
Start index
length -
Length of range
|
| Returns |
this array modified |
Removes given range from this array.
| Parameters |
start -
Start index
length -
Length of range
|
| Returns |
this array modified |
Removes and returns first key=>value
from this array.
Returns an iterator of values in this array.
Adds given element to end of array.
| Parameters |
element -
Element to add
|
Finds and returns the key of first mapping whose value
was equal to given parameter.
| Parameters |
value -
Value to search for
|
| Returns |
Key of matched mapping, or undefined. |
Finds and returns all mappings whose value was equal to given parameter.
| Parameters |
value -
Value to search for
|
| Returns |
Array containing matched mappings |
Returns the first mapping in this array.
Returns the key of first mapping in this array.
Returns the value of first mapping in this array.
Fetches value from multi dimensional array. (i.e. array
containing nested arrays). If missing key is encountered
undefined is returned.
Gets the default value returned if non-existent
key is acccessed.
Returns list of values in this array.
Returns list of keys in this array.
Returns new array containing all mappings whose
key and/or value matched given regular expressions.
| Parameters |
keyPattern -
Regular expression to match keys with
valuePattern -
Regular expression to match values with
matchBoth -
if true both key and value is required to match.
|
| Returns |
New array containing selected mappings |
| Throws |
MalformedPattern -
If any of patterns where invalid
|
Returns new array containing all mappings whose
key matched matched given regular expression.
| Parameters |
pattern -
Regular expression to match with
|
| Returns |
New array containing selected mappings |
| Throws |
MalformedPattern -
If pattern was invalid
|
Returns new array containing all mappings whose
value matched matched given regular expression.
| Parameters |
pattern -
Regular expression to match with
|
| Returns |
New array containing selected mappings |
| Throws |
MalformedPattern -
If pattern was invalid
|
Inserts the mapped values of given array into given range in this array.
| Parameters |
values -
Values to insert
start -
Start index in this array
length -
Length of range to overwrite
|
| Returns |
this array modified |
Removes mappings whose key does not appear in both this array
and given set.
| Parameters |
set -
Set of mappings
|
| Returns |
this array modified |
Joins the string representation of mapped values in this array
together with given clue.
| Parameters |
clue -
Separator between values
|
Returns the mapped key at given index.
| Parameters |
index -
Index to array
|
Returns an iterator of keys in this array.
Returns an iterator of keys and values in this array.
Returns the last mapping in this array.
Returns the key of last mapping in this array.
Returns the value of last mapping in this array.
Finds and returns minimum and maximum value from this array.
| Returns |
tuple containing (minElement, maxElement) |
Finds and returns minimum and maximum key from this array.
| Returns |
tuple containing (minKey, maxKey) |
Return the next mapping of mapping
mapped with given key.
Return the key of next mapping of mapping
mapped with given key.
Return the value of next mapping of mapping
mapped with given key.
Removes the last mapping from this array and
returns the value mapped.
Return the index of mappping with given key.
Return the previous mapping of mapping
mapped with given key.
Return the key of previous mapping of mapping
mapped with given key.
| Parameters |
ofKey -
Key to array
|
Return the value of previous mapping of mapping
mapped with given key.
| Parameters |
ofKey -
Key to array
|
For each parameter, inserts the value or mapping into
the end of this array.
Reverses to order of mappings in this array.
| Returns |
this array reversed |
Returns an iterator containing all mappings for which given function
returned true.
| Parameters |
selector -
Callable selector:
function selector(key, value, index)
|
| Returns |
New array containing selected elements. |
Sets value at given multi-dimensional array (i.e. array
containing nested array). If missing key is encountered
arrays remain unchanged.
Sets the default value that will be returned if non-existent
key is acccessed.
Removes the first mapping from this array and
returns the value mapped.
Returns the number of elements in array
| Returns |
Number of elements |
Returns the number of elements in array
| Returns |
Number of elements |
Return mappings from given range.
| Parameters |
start -
Start index
length -
Length of range
|
| Returns |
Mappings from given range |
Sorts this array.
| Parameters |
comparator -
Comparator function
function comparator(key1, elem1, key2, elem2),
Function should
return less than 0 if elem1<elem2, 0 if elem1==elem2 or
more than 0 if elem1>elem2.
|
| Returns |
this array sorted |
Sorts this array according to keys.
| Returns |
this array sorted |
Sorts this array according to mapped values.
| Returns |
this array sorted |
Subtract mappings with the same keys as in given set.
| Parameters |
set -
Set of mappings.
|
| Returns |
this array subtracted |
Swaps the values pointed by given keys.
Swaps order the mappings pointed by given keys.
Merges the keys and values. Existing values in this array are not overridden.
| Parameters |
set -
Array to merge with
|
| Returns |
this array modified |
For each parameter, inserts the value or mapping into
the start of this array.
| Parameters |
mapping -
Mapping to add
value -
Value to add
|
| Returns |
this array modified |
Returns the mapped value at given index.
| Parameters |
index -
Index to array
|
Operators
Returns the number of elements in this array.
boolean (boolean)self
true if number of mappings in this array is greater than 0,
false otherwise.
object
this[
object key]
Returns element at given key
array
this[
object start..object end]
Returns array from given range
array
this[indices...]
Returns array of elements
at given keys and ranges
| Parameters |
key -
key to array
start -
start key of range (included)
end -
end key of range (included)
|
this[
object key] = object
Sets the element at given index
this[
object start..object end] = object
Sets the content of range
this[
object start..object end] = array
Sets the content of range
| Parameters |
key -
key to array
start -
start key of range (included)
end -
end key of range (included)
|
this[] = object
Appends element to end of this sequence
this[] = map
Appends mapping to end of this sequence
delete
this[
object key]
Removes element at given key
delete
this[
object start..object end]
Removes given range
delete
this[indices...]
Removes keys and ranges
| Parameters |
key -
key to array
start -
start key of range (included)
end -
end key of range (included)
|
object in
this Checks if given element is in this array
map in
this Checks if given mapping is in this array
Returns iterator of keys and elements in this array