|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.core.client.JavaScriptObject
com.maryanovsky.gwtutils.client.JsMixedArray
public final class JsMixedArray
An overlay for a non-homogenous JavaScript array. It's up to the user to know the actual types of the elements.
Constructor Summary | |
---|---|
protected |
JsMixedArray()
The required no-arg protected constructor. |
Method Summary | |
---|---|
boolean |
getBoolean(int index)
Returns the element at the specified index, as a boolean. |
double |
getDouble(int index)
Returns the element at the specified index, as a double. |
int |
getInt(int index)
Returns the element at the specified index, as an integer. |
JavaScriptObject |
getObject(int index)
Returns the element at the specified index, as a raw JavaScriptObject . |
String |
getString(int index)
Returns the element at the specified index, as a String. |
String |
join()
Converts each element of the array into a string and joins them together with a comma separator. |
String |
join(String separator)
Converts each element of the array into a string and joins them together with the specified separator. |
int |
length()
Returns the size of the array. |
void |
pushBoolean(boolean value)
Pushes the specified String value onto the end of the array. |
void |
pushDouble(double value)
Pushes the specified double value onto the end of the array. |
void |
pushInt(int value)
Pushes the specified integer value onto the end of the array. |
void |
pushObject(JavaScriptObject value)
Pushes the specified raw JavaScriptObject value onto the end of
the array. |
void |
pushString(String value)
Pushes the specified String value onto the end of the array. |
void |
setBoolean(int index,
boolean value)
Sets the value at the specified index to the specified boolean. |
void |
setDouble(int index,
double value)
Sets the value at the specified index to the specified double. |
void |
setInt(int index,
int value)
Sets the value at the specified index to the specified integer. |
void |
setLength(int length)
Sets the length of the array. |
void |
setObject(int index,
JavaScriptObject value)
Sets the value at the specified index to the specified raw JavaScriptObject . |
void |
setString(int index,
String value)
Sets the value at the specified index to the specified String. |
boolean |
shiftBoolean()
Removes the first element of the array and returns it, as a boolean. |
double |
shiftDouble()
Removes the first element of the array and returns it, as a double. |
int |
shiftInt()
Removes the first element of the array and returns it, as an integer. |
JavaScriptObject |
shiftObject()
Removes the first element of the array and returns it, as a raw JavaScriptObject . |
String |
shiftString()
Removes the first element of the array and returns it, as an String. |
void |
unshiftBoolean(boolean value)
Pushes the specified boolean value into the beginning of the array. |
void |
unshiftDouble(double value)
Pushes the specified double value into the beginning of the array. |
void |
unshiftInt(int value)
Pushes the specified integer value into the beginning of the array. |
void |
unshiftObject(JavaScriptObject value)
Pushes the specified raw JavaScriptObject value into the
beginning of the array. |
void |
unshiftString(String value)
Pushes the specified String value into the beginning of the array. |
Methods inherited from class com.google.gwt.core.client.JavaScriptObject |
---|
cast, 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 JsMixedArray()
Method Detail |
---|
public int length()
public void setLength(int length)
public int getInt(int index)
public String getString(int index)
public double getDouble(int index)
public boolean getBoolean(int index)
public JavaScriptObject getObject(int index)
JavaScriptObject
.
public void setInt(int index, int value)
public void setString(int index, String value)
public void setDouble(int index, double value)
public void setBoolean(int index, boolean value)
public void setObject(int index, JavaScriptObject value)
JavaScriptObject
.
public void pushInt(int value)
public void pushString(String value)
public void pushDouble(double value)
public void pushBoolean(boolean value)
public void pushObject(JavaScriptObject value)
JavaScriptObject
value onto the end of
the array.
public int shiftInt()
public String shiftString()
public double shiftDouble()
public boolean shiftBoolean()
public JavaScriptObject shiftObject()
JavaScriptObject
.
public void unshiftInt(int value)
public void unshiftString(String value)
public void unshiftDouble(double value)
public void unshiftBoolean(boolean value)
public void unshiftObject(JavaScriptObject value)
JavaScriptObject
value into the
beginning of the array.
public String join()
public String join(String separator)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |