public class

JsArrayMixed

extends JavaScriptObject
java.lang.Object
   ↳ com.google.gwt.core.client.JavaScriptObject
     ↳ com.google.gwt.core.client.JsArrayMixed

Class Overview

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, ]; }-* /;

Summary

Protected Constructors
JsArrayMixed()
Public Methods
final boolean getBoolean(int index)
Gets the boolean at a given index.
final double getNumber(int index)
Gets the double at a given index.
final <T extends JavaScriptObject> T getObject(int index)
Gets the JavaScriptObject at a given index.
final String getString(int index)
Gets the String at a given index.
final String join()
Convert each element of the array to a String and join them with a comma separator.
final String join(String separator)
Convert each element of the array to a String and join them with a comma separator.
final int length()
Gets the length of the array.
final void push(String value)
Pushes the given String onto the end of the array.
final void push(JavaScriptObject value)
Pushes the given JavaScriptObject onto the end of the array.
final void push(boolean value)
Pushes the given boolean onto the end of the array.
final void push(double value)
Pushes the given double onto the end of the array.
final void set(int index, boolean value)
Sets the boolean value at a given index.
final void set(int index, JavaScriptObject value)
Sets the object value at a given index.
final void set(int index, String value)
Sets the String value at a given index.
final void set(int index, double value)
Sets the double value at a given index.
final void setLength(int newLength)
Reset the length of the array.
final boolean shiftBoolean()
Shifts the first value off the array.
final double shiftNumber()
Shifts the first value off the array.
final <T extends JavaScriptObject> T shiftObject()
Shifts the first value off the array.
final String shiftString()
Shifts the first value off the array.
final void unshift(double value)
Shifts a double onto the beginning of the array.
final void unshift(String value)
Shifts a String onto the beginning of the array.
final void unshift(boolean value)
Shifts a boolean onto the beginning of the array.
final void unshift(JavaScriptObject value)
Shifts a JavaScriptObject onto the beginning of the array.
[Expand]
Inherited Methods
From class com.google.gwt.core.client.JavaScriptObject
From class java.lang.Object

Protected Constructors

protected JsArrayMixed ()

Public Methods

public final boolean getBoolean (int index)

Gets the boolean at a given index.

Parameters
index the index to be retrieved
Returns
  • the object at the given index, or null if none exists

public final double getNumber (int index)

Gets the double at a given index.

Parameters
index the index to be retrieved
Returns
  • the object at the given index, or null if none exists

public final T getObject (int index)

Gets the JavaScriptObject at a given index.

Parameters
index the index to be retrieved
Returns
  • the JavaScriptObject at the given index, or null if none exists

public final String getString (int index)

Gets the String at a given index.

Parameters
index the index to be retrieved
Returns
  • the object at the given index, or null if none exists

public final String join ()

Convert each element of the array to a String and join them with a comma separator. The value returned from this method may vary between browsers based on how JavaScript values are converted into strings.

public final String join (String separator)

Convert each element of the array to a String and join them with a comma separator. The value returned from this method may vary between browsers based on how JavaScript values are converted into strings.

public final int length ()

Gets the length of the array.

Returns
  • the array length

public final void push (String value)

Pushes the given String onto the end of the array.

public final void push (JavaScriptObject value)

Pushes the given JavaScriptObject onto the end of the array.

public final void push (boolean value)

Pushes the given boolean onto the end of the array.

public final void push (double value)

Pushes the given double onto the end of the array.

public final void set (int index, boolean value)

Sets the boolean 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 boolean to be stored

public final void set (int index, JavaScriptObject value)

Sets the object 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 object.

Parameters
index the index to be set
value the JavaScriptObject to be stored

public final void set (int index, String value)

Sets the String 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 String.

Parameters
index the index to be set
value the String to be stored

public final void set (int index, double value)

Sets the double 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 double to be stored

public final void setLength (int newLength)

Reset the length of the array.

Parameters
newLength the new length of the array

public final boolean shiftBoolean ()

Shifts the first value off the array.

Returns
  • the shifted boolean

public final double shiftNumber ()

Shifts the first value off the array.

Returns
  • the shifted double

public final T shiftObject ()

Shifts the first value off the array.

Returns

public final String shiftString ()

Shifts the first value off the array.

Returns
  • the shifted String

public final void unshift (double value)

Shifts a double onto the beginning of the array.

Parameters
value the value to store

public final void unshift (String value)

Shifts a String onto the beginning of the array.

Parameters
value the value to store

public final void unshift (boolean value)

Shifts a boolean onto the beginning of the array.

Parameters
value the value to the stored

public final void unshift (JavaScriptObject value)

Shifts a JavaScriptObject onto the beginning of the array.

Parameters
value the value to store