public class ImmutableArray<T>
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static <T> ImmutableArray<T> |
from(T[] a)
Factory alternative to the constructor.
|
T |
get(int index)
Get the specified element.
|
int |
length()
Get the number of elements in the array.
|
public static <T> ImmutableArray<T> from(T[] a)
a - the arraypublic T get(int index)
index - the index of the elementjava.lang.ArrayIndexOutOfBoundsException - if the index is less than zero
or larger than the arraypublic int length()