|
GWT 2.7.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.google.gwt.core.client.JavaScriptObject com.google.gwt.core.client.JsArrayMixed
public class JsArrayMixed
A simple wrapper around an heterogeneous native array of values.
This class may not be directly instantiated, and can only be returned from a
native method. For example,
native JsArrayMixed getNativeArray() /*-{
return [
{ x: 0, y: 1},
"apple",
12345,
];
}-* /;
Constructor Summary | |
---|---|
protected |
JsArrayMixed()
|
Method Summary | ||
---|---|---|
boolean |
getBoolean(int index)
Gets the boolean at a given index. |
|
double |
getNumber(int index)
Gets the double at a given index. |
|
|
getObject(int index)
Gets the JavaScriptObject at a given index. |
|
java.lang.String |
getString(int index)
Gets the String at a given index. |
|
java.lang.String |
join()
Convert each element of the array to a String and join them with a comma separator. |
|
java.lang.String |
join(java.lang.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(boolean value)
Pushes the given boolean onto the end of the array. |
|
void |
push(double value)
Pushes the given double onto the end of the array. |
|
void |
push(JavaScriptObject value)
Pushes the given JavaScriptObject onto the end of the array. |
|
void |
push(java.lang.String value)
Pushes the given String onto the end of the array. |
|
void |
set(int index,
boolean value)
Sets the boolean value at a given index. |
|
void |
set(int index,
double value)
Sets the double value at a given index. |
|
void |
set(int index,
JavaScriptObject value)
Sets the object value at a given index. |
|
void |
set(int index,
java.lang.String value)
Sets the String value at a given index. |
|
void |
setLength(int newLength)
Reset the length of the array. |
|
boolean |
shiftBoolean()
Shifts the first value off the array. |
|
double |
shiftNumber()
Shifts the first value off the array. |
|
|
shiftObject()
Shifts the first value off the array. |
|
java.lang.String |
shiftString()
Shifts the first value off the array. |
|
void |
unshift(boolean value)
Shifts a boolean onto the beginning of the array. |
|
void |
unshift(double value)
Shifts a double onto the beginning of the array. |
|
void |
unshift(JavaScriptObject value)
Shifts a JavaScriptObject onto the beginning of the array. |
|
void |
unshift(java.lang.String value)
Shifts a String onto the beginning of the array. |
Methods inherited from class com.google.gwt.core.client.JavaScriptObject |
---|
cast, createArray, createArray, createFunction, createObject, equals, hashCode, toSource, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected JsArrayMixed()
Method Detail |
---|
public final boolean getBoolean(int index)
index
- the index to be retrieved
public final double getNumber(int index)
index
- the index to be retrieved
public final <T extends JavaScriptObject> T getObject(int index)
JavaScriptObject
at a given index.
index
- the index to be retrieved
JavaScriptObject
at the given index, or
null
if none existspublic final java.lang.String getString(int index)
index
- the index to be retrieved
null
if none existspublic final java.lang.String join()
public final java.lang.String join(java.lang.String separator)
public final int length()
public final void push(boolean value)
public final void push(double value)
public final void push(JavaScriptObject value)
JavaScriptObject
onto the end of the array.
public final void push(java.lang.String value)
public final void set(int index, boolean value)
index
- the index to be setvalue
- the boolean to be storedpublic final void set(int index, double value)
index
- the index to be setvalue
- the double to be storedpublic final void set(int index, JavaScriptObject value)
index
- the index to be setvalue
- the JavaScriptObject
to be storedpublic final void set(int index, java.lang.String value)
index
- the index to be setvalue
- the String to be storedpublic final void setLength(int newLength)
newLength
- the new length of the arraypublic final boolean shiftBoolean()
public final double shiftNumber()
public final <T extends JavaScriptObject> T shiftObject()
JavaScriptObject
public final java.lang.String shiftString()
public final void unshift(boolean value)
value
- the value to the storedpublic final void unshift(double value)
value
- the value to storepublic final void unshift(JavaScriptObject value)
JavaScriptObject
onto the beginning of the array.
value
- the value to storepublic final void unshift(java.lang.String value)
value
- the value to store
|
GWT 2.7.0 | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |