com.google.gwt.core.client
Class JsArrayString
java.lang.Object
com.google.gwt.core.client.JavaScriptObject
com.google.gwt.core.client.JsArrayString
public class JsArrayString
- extends JavaScriptObject
A simple wrapper around a homogeneous native array of string values.
This class may not be directly instantiated, and can only be returned from a
native method. For example,
native JsArrayString getNativeArray() /*-{
return ['foo', 'bar', 'baz'];
}-* /;
Method Summary |
java.lang.String |
get(int index)
Gets the value at a given index. |
int |
length()
Gets the length of the array. |
void |
set(int index,
java.lang.String value)
Sets the value value at a given index. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
JsArrayString
protected JsArrayString()
get
public final java.lang.String get(int index)
- Gets the value at a given index.
- Parameters:
index
- the index to be retrieved
- Returns:
- the value at the given index, or
null
if none exists
length
public final int length()
- Gets the length of the array.
- Returns:
- the array length
set
public final void set(int index,
java.lang.String 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 setvalue
- the value to be stored