com.google.maps.gwt.client
Class MVCArray<A extends JavaScriptObject>

java.lang.Object
  extended by JavaScriptObject
      extended by com.google.maps.gwt.client.MVCArray<A>

public class MVCArray<A extends JavaScriptObject>
extends JavaScriptObject

MVCArray adds type parameterization to the generated MVCArray wrapper included in the Maps codebase.


Nested Class Summary
static interface MVCArray.ForEachCallback<T extends JavaScriptObject>
          Callback type for handling asynchronous responses from forEach.
 
Constructor Summary
protected MVCArray()
          Protected constructor for internal use only.
 
Method Summary
 void clear()
          Removes all elements from the array.
static
<T extends JavaScriptObject>
MVCArray<T>
create()
          A mutable MVC Array.
static
<T extends JavaScriptObject>
MVCArray<T>
create( array)
          A mutable MVC Array.
 void forEach(MVCArray.ForEachCallback<A> callback)
          Iterate over each element, calling the provided callback.
  getArray()
          Returns a reference to the underlying Array.
 A getAt(double i)
          Get an element at the specified index.
 double getLength()
          Returns the number of elements in this array.
 void insertAt(double i, A elem)
          Inserts an element at the specified index.
 A pop()
          Removes the last element of the array and returns that element.
 double push(A elem)
          Adds one element to the end of the array and returns the new length of the array.
 A removeAt(double i)
          Removes an element from the specified index.
 void setAt(double i, A elem)
          Sets an element at the specified index.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MVCArray

protected MVCArray()
Protected constructor for internal use only.

Method Detail

create

public static final <T extends JavaScriptObject> MVCArray<T> create( array)
A mutable MVC Array.


create

public static final <T extends JavaScriptObject> MVCArray<T> create()
A mutable MVC Array.


clear

public final void clear()
Removes all elements from the array.


forEach

public final void forEach(MVCArray.ForEachCallback<A> callback)
Iterate over each element, calling the provided callback. The callback is called for each element like: callback(element, index).


getArray

public final  getArray()
Returns a reference to the underlying Array. Warning: if the Array is mutated, no events will be fired by this object.


getAt

public final A getAt(double i)
Get an element at the specified index.


getLength

public final double getLength()
Returns the number of elements in this array.


insertAt

public final void insertAt(double i,
                           A elem)
Inserts an element at the specified index.


pop

public final A pop()
Removes the last element of the array and returns that element.


push

public final double push(A elem)
Adds one element to the end of the array and returns the new length of the array.


removeAt

public final A removeAt(double i)
Removes an element from the specified index.


setAt

public final void setAt(double i,
                        A elem)
Sets an element at the specified index.