Native JavaScript class Array. Includes GI extensions.
| Method Summary |
|---|
| Array | Deprecated. Use the jsx3.util.List class.
|
| native Array | Joins two or more arrays and returns a new array. |
| void | Deprecated. Use the jsx3.util.List class.
|
| boolean | Deprecated. Use the jsx3.util.List class.
|
| Array | Deprecated. Use the jsx3.util.List class.
|
| int | Deprecated. Use the jsx3.util.List class.
|
| native String | Joins all elements of an array into a string. |
| int | Deprecated. Use the jsx3.util.List class.
|
| Array | Object | Deprecated. Use the jsx3.util.List class.
|
| native Object | Removes the last element from an array and returns that element. |
| native int | Adds one or more elements to the end of an array and returns the new length of the array. |
| void | Deprecated. Use the jsx3.util.List class.
|
| void | Deprecated. Use the jsx3.util.List class.
|
| native void | Transposes the elements of an array: the first array element becomes the last and the last becomes the first. |
| native Object | Removes the first element from an array and returns that element. |
| native Array | Extracts a section of an array and returns a new array. |
| native void | Sorts the elements of an array. |
| native Array | Changes the content of an array, adding new elements while removing old elements. |
| native String | Returns a string representing the specified array and its elements. |
| native int | Adds one or more elements to the beginning of an array and returns the new length of the array. |
An unsigned, 32-bit integer that specifies the number of elements in an array.
Deprecated. Use the jsx3.util.List class.
creates a copy of this array
Returns:
Joins two or more arrays and returns a new array.
Parameters:
Returns:
Deprecated. Use the jsx3.util.List class.
Parameters:
Deprecated. Use the jsx3.util.List class.
Returns true if this array and
a have the same length and this[n] = a[n] for all n.
Parameters:
Returns:
Deprecated. Use the jsx3.util.List class.
Creates a new array with the filtered contents of this array. The
fctFilter parameter defines
the filtering function.
Parameters:
fctFilter – a function that is called once for each item in this array and returns true if the item
should be included in the filtered list. The signature of this function is
function(item : Object) : boolean.
Returns:
Since:
3.1
Deprecated. Use the jsx3.util.List class.
Returns the index of the first occurrence of
objElement in this array.
Parameters:
objElement – the item to find
intStartAt –
Returns:
the index of the found object or -1 if not found
Joins all elements of an array into a string.
Parameters:
Returns:
Deprecated. Use the jsx3.util.List class.
Returns the index of the last occurrence of
objElement in this array.
Parameters:
objElement – the item to find
intStartAt –
Returns:
the index of the found object or -1 if not found
Deprecated. Use the jsx3.util.List class.
Creates a new array with the mapped contents of this array. The
fctMapper parameter defines
the mapping function.
This method has four modes corresponding to the four possible values for
{bExpand, bObject}:
-
{false, false} (default) – the filtering function takes an item in this list and returns
a single object value which will take the place of the item in the mapped result.
-
{true, false} – the filtering function takes an item in this list and returns
a single object value or an array of values, all of which will be inserted into the mapped result at the index
of the item.
-
{false, true} – the filtering function takes an item in this list and returns an array with
exactly two values, which become a name/value pair in the mapped result.
-
{true, true} – the filtering function takes an item in this list and returns an array with
zero or an even number of items, which become name/value pairs in the mapped result.
Parameters:
fctMapper – a function that is called once for each item in this array and returns the mapped
value. The signature of this function depends on the values for the bExpand and
bObject parameters.
bExpand – if true, the resulting mapped array or object may any number of values
corresponding to each item in this list. Otherwise, it will have exactly one value for each item in this list.
bObject – if true, this array is mapped to an object with property name/value pairs.
Otherwise this array is mapped to another array.
Returns:
an Array if the bObject parameter is null or
false, otherwise an Object.
Since:
3.1
Removes the last element from an array and returns that element. This method changes the length of the array.
Returns:
Adds one or more elements to the end of an array and returns the new length of the array. This method changes
the length of the array.
Parameters:
Returns:
the new length of the array
Deprecated. Use the jsx3.util.List class.
pushes the contents of an Array onto this Array.
Parameters:
Deprecated. Use the jsx3.util.List class.
removes the first occurrence of
objElement in this array
Parameters:
objElement – the object to remove
Returns:
the removed object or null if no object was removed
Transposes the elements of an array: the first array element becomes the last and the last becomes the first.
Removes the first element from an array and returns that element. This method changes the length of the array.
Returns:
Extracts a section of an array and returns a new array.
- slice extracts up to but not including end. slice(1,4) extracts the second element through the fourth element (elements indexed 1, 2, and 3)
- As a negative index, end indicates an offset from the end of the sequence. slice(2,-1) extracts the third element through the second to last element in the sequence.
- If end is omitted, slice extracts to the end of the sequence.
Parameters:
begin – Zero-based index at which to begin extraction.
end – Zero-based index at which to end extraction.
Returns:
Sorts the elements of an array.
If compareFunction is supplied, the array elements are sorted according to the return value of the compare
function. If a and b are two elements being compared, then:
- If compareFunction(a, b) is less than 0, sort b to a lower index than a.
- If compareFunction(a, b) returns 0, leave a and b unchanged with respect to each other, but sorted with respect to all different elements.
- If compareFunction(a, b) is greater than 0, sort b to a higher index than a.
Parameters:
compareFunction – Specifies a function that defines the sort order. If omitted, the array
is sorted lexicographically (in dictionary order) according to the string conversion of each element.
Changes the content of an array, adding new elements while removing old elements.
Parameters:
index – Index at which to start changing the array.
howMany – An integer indicating the number of old array elements to remove. If howMany is 0, no
elements are removed. In this case, you should specify at least one new element.
element – The elements to add to the array. If you don't specify any elements, splice simply
removes elements from the array.
Returns:
an array containing the removed elements
Returns a string representing the specified array and its elements.
Returns:
Overrides:
Adds one or more elements to the beginning of an array and returns the new length of the array.
Parameters:
Returns:
the new length of the array
Copyright © 2001-2009, TIBCO Software Inc.