org.cruxframework.crux.core.client.collection
Class Array<E>

java.lang.Object
  extended by com.google.gwt.core.client.JavaScriptObject
      extended by org.cruxframework.crux.core.client.collection.Array<E>
Type Parameters:
E - The type stored in the array elements

public class Array<E>
extends com.google.gwt.core.client.JavaScriptObject

The root Array type that provides read-access to an array that might still be mutable by another actor.


Constructor Summary
protected Array()
           
 
Method Summary
 void add(E elem)
           
 void clear()
           
 E get(int index)
           
 int indexOf(E elem)
           
 void insert(int index, E elem)
          Inserts elem before the element residing at index.
 void remove(int index)
          Removes the element at the specified index.
 void set(int index, E elem)
          Replaces the element at the specified index.
 void setSize(int newSize, E fillValue)
          Changes the array size.
 int size()
           
 
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

Array

protected Array()
Method Detail

add

public final void add(E elem)

clear

public final void clear()

get

public final E get(int index)

indexOf

public final int indexOf(E elem)
Parameters:
elem -
Returns:

insert

public final void insert(int index,
                         E elem)
Inserts elem before the element residing at index.

Parameters:
index - in the range [0, this.size()], inclusive; if index is equal to the array's current size, the result is equivalent to calling add(Object)
elem - the element to insert or null

remove

public final void remove(int index)
Removes the element at the specified index.


set

public final void set(int index,
                      E elem)
Replaces the element at the specified index.

Parameters:
index - in the range [0, this.size()), exclusive
elem - the element to insert or null

setSize

public final void setSize(int newSize,
                          E fillValue)
Changes the array size. If newSize is less than the current size, the array is truncated. If newSize is greater than the current size the array is grown and the new elements of the array filled up with fillValue.


size

public final int size()


Copyright © 2014. All rights reserved.