Class ImmutableArray<T>

java.lang.Object
com.mapr.utils.ImmutableArray<T>

public class ImmutableArray<T> extends Object
  • Method Details

    • 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:
      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.