OracleJavaScript API Reference for Oracle ADF Faces

 

SUMMARY: FIELD | CONSTR | METHOD    DETAIL: FIELD | CONSTR | METHOD

org.ecmascript.object
Class Array

org.ecmascript.object.Object
   |
   +--org.ecmascript.object.Array

public class Array
extends Object
The native browser JavaScript object used to store multiple values in a single variable.
An instance can also be created with the shorthand [].

Note that this object is implemented and supported by the web browser and results of its use may vary.



Field Summary

public Number
length
The number of elements in the array.


Fields inherited from org.ecmascript.object.Object

constructor, prototype


Constructor Summary

public
Array(Object... args)
The native browser JavaScript object used to store multiple values in a single variable.


Method Summary

public Array
concat(Array... args)
Joins two or more arrays without changing the existing arrays.
public String
join(String separator)
Puts all of the elements of the array into a string.
public Object
pop()
Removes and returns the last element of the array.
public Number
push(Object... args)
Adds one or more elements to the end of the array and returns the new length of the array.
public Array
reverse()
Modifies the array by reversing the order of the elements in the array.
public Object
shift()
Removes and returns the first element of the array.
public Number
slice(Number start, Number end)
Returns a subsection of elements from the array.
public Array
sort(Function sortBy)
Modifies the array by arranging the elements according to the sortBy function.
public Number
splice(Number index, Number removeCount, Object... args)
Removes and adds new elements to the array.
public String
toSource()
Generates a JSON (JavaScript Object Notation) representation of the array.
public String
toString()
Generates a comma-separated listing of the element in the array.
public Number
unshift(Object... args)
Adds one or more elements to the beginning of the array and returns the new length of the array.


Field Detail


length

public Number length

The number of elements in the array.

Constructor Detail


Array

public Array(Object... args)

The native browser JavaScript object used to store multiple values in a single variable.
An instance can also be created with the shorthand [].

Note that this object is implemented and supported by the web browser and results of its use may vary.

Parameters:
args  -  zero or more initial values for the array

Method Detail


concat

public Array concat(Array... args)

Joins two or more arrays without changing the existing arrays.

Parameters:
args  -  one or more arrays to concatenate with this array
Return:
Array - a copy of the joined Arrays

join

public String join(String separator)

Puts all of the elements of the array into a string.

Parameters:
separator  -  optional separator to add between each element
Return:
String - a string containing all of the elements in the array separated by the optional separator

pop

public Object pop()

Removes and returns the last element of the array.

Return:
Object - the last element of the array or undefined if empty
See also:
push(Object...)

push

public Number push(Object... args)

Adds one or more elements to the end of the array and returns the new length of the array.

Parameters:
args  -  one or more new elements to add to the end of the array
Return:
Number - the new length of the array
See also:
unshift(Object...)

reverse

public Array reverse()

Modifies the array by reversing the order of the elements in the array.

Return:
Array - the array

shift

public Object shift()

Removes and returns the first element of the array.

Return:
Object - the first element of the array or undefined if empty
See also:
pop()

slice

public Number slice(Number start,
                    Number end)

Returns a subsection of elements from the array.

Parameters:
start  -  the starting index of the subsection. If negative, the index will be counted from the end of the array.
end  -  optional ending index of the subsection. If not specified, all elements starting from start will be selected.
Return:
Number - the new length of the array

sort

public Array sort(Function sortBy)

Modifies the array by arranging the elements according to the sortBy function.

Parameters:
sortBy  -  optional function with two parameters that returns a Number that is positive if the first parameter is larger than the second parameter, negative for the reverse comparison, or zero if the two are equal. If not specified, the sort is alphabetical.
Return:
Array - the array

splice

public Number splice(Number index,
                     Number removeCount,
                     Object... args)

Removes and adds new elements to the array.

Parameters:
index  -  the index at which to add and remove elements
removeCount  -  a non-negative number indicating how many elements to remove at the index
args  -  one or more new elements to add to the array
Return:
Number - the new length of the array

toSource

public String toSource()

Generates a JSON (JavaScript Object Notation) representation of the array.

Return:
String - a JSON representation of the array

toString

public String toString()

Generates a comma-separated listing of the element in the array.

Return:
String - a comma-separated listing of the element in the array

unshift

public Number unshift(Object... args)

Adds one or more elements to the beginning of the array and returns the new length of the array.

Parameters:
args  -  one or more new elements to add to the array
Return:
Number - the new length of the array
See also:
push(Object...)

SUMMARY: FIELD | CONSTR | METHOD    DETAIL: FIELD | CONSTR | METHOD

 

Generated on 2011.04.27 02:28 UTC
Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved.