com.google.gwt.core.client
Class JsArrayInteger

java.lang.Object
  extended by com.google.gwt.core.client.JavaScriptObject
      extended by com.google.gwt.core.client.JsArrayInteger

public class JsArrayInteger
extends JavaScriptObject

A simple wrapper around a homogeneous native array of integer values. This class may not be directly instantiated, and can only be returned from a native method. For example, native JsArrayInteger getNativeArray() /*-{ return [1, 2, 3]; }-* /;


Constructor Summary
protected JsArrayInteger()
           
 
Method Summary
 int get(int index)
          Gets the value at a given index.
 int length()
          Gets the length of the array.
 void set(int index, int value)
          Sets the value value at a given index.
 
Methods inherited from class com.google.gwt.core.client.JavaScriptObject
cast, createArray, createFunction, createObject, equals, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JsArrayInteger

protected JsArrayInteger()
Method Detail

get

public final int get(int index)
Gets the value at a given index. If no value exists at the given index, a type-conversion error will occur in hosted mode and unpredictable behavior may occur in web mode. If the numeric value returned is non-integral, it will cause a warning in hosted mode, and may affect the results of mathematical expressions.

Parameters:
index - the index to be retrieved
Returns:
the value at the given index

length

public final int length()
Gets the length of the array.

Returns:
the array length

set

public final void set(int index,
                      int 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