Package ints

Class LongArray


  • public class LongArray
    extends java.lang.Object

    Interface LongArray represents an immutable long[] array.

    • Constructor Summary

      Constructors 
      Constructor Description
      LongArray​(long[] values)
      Constructs a LongArray instance from the specified values.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String asString​(LongArray ia)
      Returns a string representation of this LongArray by applying java.utils.Arrays.toString() to an equivalent int[] object.
      static boolean equals​(LongArray a, LongArray b)
      Returns true if the specified LongArray objects represent the same sequence of long values, and returns false otherwise.
      long get​(int index)
      Returns the specified array element.
      int size()
      Returns the number of elements in this LongArray.
      static long[] toArray​(LongArray la)
      Returns a copy of the specified array.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LongArray

        public LongArray​(long[] values)
        Constructs a LongArray instance from the specified values.
        Parameters:
        values - a long array
        Throws:
        java.lang.NullPointerException - if values == null
    • Method Detail

      • size

        public int size()
        Returns the number of elements in this LongArray.
        Returns:
        the number of elements in this LongArray
      • get

        public long get​(int index)
        Returns the specified array element.
        Parameters:
        index - an array index
        Returns:
        the specified array element
        Throws:
        java.lang.IndexOutOfBoundsException - if index < 0 || index >= this.size()
      • toArray

        public static long[] toArray​(LongArray la)
        Returns a copy of the specified array.
        Parameters:
        la - a list of longs
        Returns:
        a copy of the specified array
        Throws:
        java.lang.NullPointerException - if ia == null
      • asString

        public static java.lang.String asString​(LongArray ia)
        Returns a string representation of this LongArray by applying java.utils.Arrays.toString() to an equivalent int[] object.
        Parameters:
        ia - a list of longs
        Returns:
        a string representation of this LongArray.
        Throws:
        java.lang.NullPointerException - if ia == null
      • equals

        public static boolean equals​(LongArray a,
                                     LongArray b)
        Returns true if the specified LongArray objects represent the same sequence of long values, and returns false otherwise.
        Parameters:
        a - a sequence of long values
        b - a sequence of long values
        Returns:
        true if the specified LongArray objects represent the same sequence of long values