Package com.mapr.utils
Class ImmutableArray<T>
- java.lang.Object
-
- com.mapr.utils.ImmutableArray<T>
-
public class ImmutableArray<T> extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> ImmutableArray<T>from(T[] a)Factory alternative to the constructor.Tget(int index)Get the specified element.intlength()Get the number of elements in the array.
-
-
-
Method Detail
-
from
public static <T> ImmutableArray<T> from(T[] a)
Factory alternative to the constructor.- Parameters:
a- the array- Returns:
- the immutable array
-
get
public T get(int index)
Get the specified element.- Parameters:
index- the index of the element- Returns:
- the value of the element
- Throws:
java.lang.ArrayIndexOutOfBoundsException- if the index is less than zero or larger than the array
-
length
public int length()
Get the number of elements in the array.- Returns:
- the number of elements in the array.
-
-