Package com.mapr.utils
Class ImmutableArray<T>
java.lang.Object
com.mapr.utils.ImmutableArray<T>
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ImmutableArray<T>from(T[] a) Factory alternative to the constructor.get(int index) Get the specified element.intlength()Get the number of elements in the array.
-
Method Details
-
from
Factory alternative to the constructor.- Parameters:
a- the array- Returns:
- the immutable array
-
get
Get the specified element.- Parameters:
index- the index of the element- Returns:
- the value of the element
- Throws:
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.
-