Package ints

Interface IntArray

    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      static java.lang.String asString​(IntArray ia)
      Returns a string representation of this IntArray by applying java.utils.Arrays.toString() to an equivalent int[] object.
      static IntArray create​(int[] ia, int valueSize)
      Returns a new IntArray instance that has the same sequence of integers as the specified array of non-negative integers.
      static IntArray create​(IntList il, int valueSize)
      Returns a new IntArray instance that has the same sequence of integers as the specified list of non-negative integers.
      static boolean equals​(IntArray a, IntArray b)
      Returns true if the specified IntArray objects represent the same sequence of integer values, and returns false otherwise.
      int get​(int index)
      Returns the specified array element.
      static int max​(IntArray ia)
      Returns the maximum element, or Integer.MIN_VALUE if this.size() == 0.
      static int min​(IntArray ia)
      Returns the minimum element, or Integer.MAX_VALUE if this.size() == 0.
      static IntArray packedCreate​(int[] ia, int valueSize)
      Returns a new IntArray instance that has the same sequence of integers as the specified array of non-negative integers.
      static IntArray packedCreate​(IntList il, int valueSize)
      Returns a new IntArray instance that has the same sequence of integers as the specified list of non-negative integers.
      int size()
      Returns the number of elements in this IntArray.
      static int[] toArray​(IntArray ia)
      Returns a copy of the specified array.
    • Method Detail

      • size

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

        int 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

        static int[] toArray​(IntArray ia)
        Returns a copy of the specified array.
        Parameters:
        ia - a list of integers
        Returns:
        a copy of the specified array
        Throws:
        java.lang.NullPointerException - if ia == null
      • asString

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

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

        static int max​(IntArray ia)
        Returns the maximum element, or Integer.MIN_VALUE if this.size() == 0.
        Parameters:
        ia - a list of integers
        Returns:
        the maximum element
        Throws:
        java.lang.NullPointerException - if ia == null
      • min

        static int min​(IntArray ia)
        Returns the minimum element, or Integer.MAX_VALUE if this.size() == 0.
        Parameters:
        ia - a list of integers
        Returns:
        the minimum element
        Throws:
        java.lang.NullPointerException - if ia == null
      • packedCreate

        static IntArray packedCreate​(int[] ia,
                                     int valueSize)
        Returns a new IntArray instance that has the same sequence of integers as the specified array of non-negative integers.
        Parameters:
        ia - the array of non-negative integers to be copied
        valueSize - the exclusive end of the range of array values
        Returns:
        a new IntArray instance that has the same sequence of integers as the specified array
        Throws:
        java.lang.IllegalArgumentException - if valueSize < 1
        java.lang.IllegalArgumentException - if (ia[j] < 0 || ia[j] > valueSize) for any index j satisfying (j >= 0 && j < ia.length)
        java.lang.NullPointerException - if ia == null
      • packedCreate

        static IntArray packedCreate​(IntList il,
                                     int valueSize)
        Returns a new IntArray instance that has the same sequence of integers as the specified list of non-negative integers.
        Parameters:
        il - the list of non-negative integers to be copied
        valueSize - the exclusive end of the range of list values
        Returns:
        a new IntArray instance that has the same sequence of integers as the specified list
        Throws:
        java.lang.IllegalArgumentException - if valueSize < 1
        java.lang.IllegalArgumentException - if (il.get(j) < 0 || il.get(j)> valueSize) for any index j satisfying (j >= 0 && j < il.size())
        java.lang.NullPointerException - if il == null
      • create

        static IntArray create​(int[] ia,
                               int valueSize)
        Returns a new IntArray instance that has the same sequence of integers as the specified array of non-negative integers. Each integer of the returned object is stored in 1, 2, or 4 bytes.
        Parameters:
        ia - the array of non-negative integers to be copied
        valueSize - the exclusive end of the range of array values
        Returns:
        a new IntArray instance that has the same sequence of integers as the specified array
        Throws:
        java.lang.IllegalArgumentException - if valueSize < 1
        java.lang.IllegalArgumentException - if (ia[j] < 0 || ia[j] > valueSize) for any index j satisfying (j >= 0 && j < ia.length)
        java.lang.NullPointerException - if ia == null
      • create

        static IntArray create​(IntList il,
                               int valueSize)
        Returns a new IntArray instance that has the same sequence of integers as the specified list of non-negative integers. Each integer of the returned object is stored in 1, 2, or 4 bytes.
        Parameters:
        il - the list of non-negative integers to be copied
        valueSize - the exclusive end of the range of list values
        Returns:
        a new IntArray instance that has the same sequence of integers as the specified list
        Throws:
        java.lang.IllegalArgumentException - if valueSize < 1
        java.lang.IllegalArgumentException - if (il.get(j) < 0 || il.get(j)> valueSize) for any index j satisfying (j >= 0 && j < il.size())
        java.lang.NullPointerException - if il == null