public class

JsArrayNumber

extends JavaScriptObject
java.lang.Object
   ↳ com.google.gwt.core.client.JavaScriptObject
     ↳ com.google.gwt.core.client.JsArrayNumber

Class Overview

A simple wrapper around a homogeneous native array of numeric values. All native JavaScript numeric values are implicitly double-precision, so only double values may be set and retrieved. This class may not be directly instantiated, and can only be returned from a native method. For example, native JsArrayNumber getNativeArray() /*-{ return [1.1, 2.2, 3.3]; }-* /;

Summary

Protected Constructors
JsArrayNumber()
Public Methods
final double get(int index)
Gets the value at a given index.
final String join(String separator)
Convert each element of the array to a String and join them with a comma separator.
final String join()
Convert each element of the array to a String and join them with a comma separator.
final int length()
Gets the length of the array.
final void push(double value)
Pushes the given number onto the end of the array.
final void set(int index, double value)
Sets the value value at a given index.
final void setLength(int newLength)
Reset the length of the array.
final double shift()
Shifts the first value off the array.
final void unshift(double value)
Shifts a value onto the beginning of the array.
[Expand]
Inherited Methods
From class com.google.gwt.core.client.JavaScriptObject
From class java.lang.Object

Protected Constructors

protected JsArrayNumber ()

Public Methods

public final double get (int index)

Gets the value at a given index. If an undefined or non-numeric value exists at the given index, a type-conversion error will occur in Development Mode and unpredictable behavior may occur in Production Mode.

Parameters
index the index to be retrieved
Returns
  • the value at the given index

public final String join (String separator)

Convert each element of the array to a String and join them with a comma separator. The value returned from this method may vary between browsers based on how JavaScript values are converted into strings.

public final String join ()

Convert each element of the array to a String and join them with a comma separator. The value returned from this method may vary between browsers based on how JavaScript values are converted into strings.

public final int length ()

Gets the length of the array.

Returns
  • the array length

public final void push (double value)

Pushes the given number onto the end of the array.

public final void set (int index, double value)

Sets the value value at a given index. If the index is out of bounds, the value will still be set. The array's length will be updated to encompass the bounds implied by the added value.

Parameters
index the index to be set
value the value to be stored

public final void setLength (int newLength)

Reset the length of the array.

Parameters
newLength the new length of the array

public final double shift ()

Shifts the first value off the array.

Returns
  • the shifted value

public final void unshift (double value)

Shifts a value onto the beginning of the array.

Parameters
value the value to the stored