public class JsArrayString extends JavaScriptObject
native JsArrayString getNativeArray() /*-{
return ['foo', 'bar', 'baz'];
}-* /;
Modifier | Constructor and Description |
---|---|
protected |
JsArrayString() |
Modifier and Type | Method and Description |
---|---|
String |
get(int index)
Gets the value at a given index.
|
String |
join()
Convert each element of the array to a String and join them with a comma
separator.
|
String |
join(String separator)
Convert each element of the array to a String and join them with a comma
separator.
|
int |
length()
Gets the length of the array.
|
void |
push(String value)
Pushes the given value onto the end of the array.
|
void |
set(int index,
String value)
Sets the value value at a given index.
|
void |
setLength(int newLength)
Reset the length of the array.
|
String |
shift()
Shifts the first value off the array.
|
void |
unshift(String value)
Shifts a value onto the beginning of the array.
|
cast, createArray, createArray, createFunction, createObject, equals, hashCode, toSource, toString
public final String get(int index)
index
- the index to be retrievednull
if none existspublic final String join()
public final String join(String separator)
public final int length()
public final void push(String value)
public final void set(int index, String value)
index
- the index to be setvalue
- the value to be storedpublic final void setLength(int newLength)
newLength
- the new length of the arraypublic final String shift()
public final void unshift(String value)
value
- the value to the storedCopyright © 2018. All rights reserved.