Interface PrimitiveArrays.Longs

Enclosing class:
PrimitiveArrays

static interface PrimitiveArrays.Longs
An array of longs.

Implementations will be thread-safe if the underlying data is not mutated. Users should ensure the underlying data is not mutated in order to get predictable behaviour. Any buffering should be done internally.

  • Method Summary

    Modifier and Type
    Method
    Description
    fromImmutableLongArray(com.google.common.primitives.ImmutableLongArray immutableLongArray)
    Returns a PrimitiveArrays.Longs wrapping immutableLongArray.
    long
    get(int position)
    Returns the long at position position.
    int
    Returns the length of this array.
    default int[]
    Decodes and returns this array as an int[].
  • Method Details

    • get

      long get(int position)
      Returns the long at position position.

      Throws an IndexOutOfBoundsException if the absolute get on the underlying implementation fails.

    • length

      int length()
      Returns the length of this array.
    • fromImmutableLongArray

      static PrimitiveArrays.Longs fromImmutableLongArray(com.google.common.primitives.ImmutableLongArray immutableLongArray)
      Returns a PrimitiveArrays.Longs wrapping immutableLongArray.
    • toIntArray

      default int[] toIntArray()
      Decodes and returns this array as an int[].

      Throws an IllegalArgumentException if any value in this array is invalid input: '<' Integer.MIN_VALUE or > Integer.MAX_VALUE.