Class Array

java.lang.Object
com.landawn.abacus.util.Array
Direct Known Subclasses:
Array.ArrayEx

public class Array extends Object
Since:
0.8
Author:
Haiyang Li
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static <T> List<T>
    asList(T... a)
    Returns a fixed-size list backed by the specified array if it's not null or empty, otherwise an immutable empty list is returned.
    static Boolean[]
    box(boolean... a)
    Converts an array of primitive booleans to objects.
    static Boolean[][]
    box(boolean[][] a)
     
    static Boolean[][][]
    box(boolean[][][] a)
     
    static Boolean[]
    box(boolean[] a, int fromIndex, int toIndex)
     
    static Byte[]
    box(byte... a)
    Converts an array of primitive bytes to objects.
    static Byte[][]
    box(byte[][] a)
     
    static Byte[][][]
    box(byte[][][] a)
     
    static Byte[]
    box(byte[] a, int fromIndex, int toIndex)
     
    static Character[]
    box(char... a)
    Converts an array of primitive chars to objects.
    static Character[][]
    box(char[][] a)
     
    static Character[][][]
    box(char[][][] a)
     
    static Character[]
    box(char[] a, int fromIndex, int toIndex)
     
    static Double[]
    box(double... a)
    Converts an array of primitive doubles to objects.
    static Double[][]
    box(double[][] a)
     
    static Double[][][]
    box(double[][][] a)
     
    static Double[]
    box(double[] a, int fromIndex, int toIndex)
     
    static Float[]
    box(float... a)
    Converts an array of primitive floats to objects.
    static Float[][]
    box(float[][] a)
     
    static Float[][][]
    box(float[][][] a)
     
    static Float[]
    box(float[] a, int fromIndex, int toIndex)
     
    static Integer[]
    box(int... a)
    Converts an array of primitive ints to objects.
    static Integer[][]
    box(int[][] a)
     
    static Integer[][][]
    box(int[][][] a)
     
    static Integer[]
    box(int[] a, int fromIndex, int toIndex)
     
    static Long[]
    box(long... a)
    Converts an array of primitive longs to objects.
    static Long[][]
    box(long[][] a)
     
    static Long[][][]
    box(long[][][] a)
     
    static Long[]
    box(long[] a, int fromIndex, int toIndex)
     
    static Short[]
    box(short... a)
    Converts an array of primitive shorts to objects.
    static Short[][]
    box(short[][] a)
     
    static Short[][][]
    box(short[][][] a)
     
    static Short[]
    box(short[] a, int fromIndex, int toIndex)
     
    static boolean[][][]
    concat(boolean[][][] a, boolean[][][] b)
     
    static boolean[][]
    concat(boolean[][] a, boolean[][] b)
     
    static byte[][][]
    concat(byte[][][] a, byte[][][] b)
     
    static byte[][]
    concat(byte[][] a, byte[][] b)
     
    static char[][][]
    concat(char[][][] a, char[][][] b)
     
    static char[][]
    concat(char[][] a, char[][] b)
     
    static double[][][]
    concat(double[][][] a, double[][][] b)
     
    static double[][]
    concat(double[][] a, double[][] b)
     
    static float[][][]
    concat(float[][][] a, float[][][] b)
     
    static float[][]
    concat(float[][] a, float[][] b)
     
    static int[][][]
    concat(int[][][] a, int[][][] b)
     
    static int[][]
    concat(int[][] a, int[][] b)
     
    static long[][][]
    concat(long[][][] a, long[][][] b)
     
    static long[][]
    concat(long[][] a, long[][] b)
     
    static short[][][]
    concat(short[][][] a, short[][][] b)
     
    static short[][]
    concat(short[][] a, short[][] b)
     
    static <T> T[][][]
    concatt(T[][][] a, T[][][] b)
     
    static <T> T[][]
    concatt(T[][] a, T[][] b)
     
    static <T> T
    get(Object array, int index)
     
    static boolean
    getBoolean(Object array, int index)
    Gets the boolean.
    static byte
    getByte(Object array, int index)
    Gets the byte.
    static char
    getChar(Object array, int index)
    Gets the char.
    static double
    getDouble(Object array, int index)
    Gets the double.
    static float
    getFloat(Object array, int index)
    Gets the float.
    static int
    getInt(Object array, int index)
    Gets the int.
    static int
    Gets the length.
    static long
    getLong(Object array, int index)
    Gets the long.
    static short
    getShort(Object array, int index)
    Gets the short.
    static <T> T
    newInstance(Class<?> componentType, int length)
     
    static <T> T
    newInstance(Class<?> componentType, int... dimensions)
     
    static boolean[]
    of(boolean... a)
    Returns the input array.
    static byte[]
    of(byte... a)
    Returns the input array.
    static char[]
    of(char... a)
    Returns the input array.
    static double[]
    of(double... a)
    Returns the input array.
    static float[]
    of(float... a)
    Returns the input array.
    static int[]
    of(int... a)
    Returns the input array.
    static long[]
    of(long... a)
    Returns the input array.
    static short[]
    of(short... a)
    Returns the input array.
    static String[]
    of(String... a)
    Returns the input array.
    static <T extends Date>
    T[]
    of(T... a)
    Returns the input array.
    static <T> T[]
    oF(T... a)
    Deprecated.
    please use N.asArray(Object...).
    static byte[]
    range(byte startInclusive, byte endExclusive)
     
    static byte[]
    range(byte startInclusive, byte endExclusive, byte by)
     
    static char[]
    range(char startInclusive, char endExclusive)
     
    static char[]
    range(char startInclusive, char endExclusive, int by)
     
    static int[]
    range(int startInclusive, int endExclusive)
     
    static int[]
    range(int startInclusive, int endExclusive, int by)
     
    static long[]
    range(long startInclusive, long endExclusive)
     
    static long[]
    range(long startInclusive, long endExclusive, long by)
     
    static short[]
    range(short startInclusive, short endExclusive)
     
    static short[]
    range(short startInclusive, short endExclusive, short by)
     
    static byte[]
    rangeClosed(byte startInclusive, byte endInclusive)
     
    static byte[]
    rangeClosed(byte startInclusive, byte endInclusive, byte by)
     
    static char[]
    rangeClosed(char startInclusive, char endInclusive)
     
    static char[]
    rangeClosed(char startInclusive, char endInclusive, int by)
     
    static int[]
    rangeClosed(int startInclusive, int endInclusive)
     
    static int[]
    rangeClosed(int startInclusive, int endInclusive, int by)
     
    static long[]
    rangeClosed(long startInclusive, long endInclusive)
     
    static long[]
    rangeClosed(long startInclusive, long endInclusive, long by)
     
    static short[]
    rangeClosed(short startInclusive, short endInclusive)
     
    static short[]
    rangeClosed(short startInclusive, short endInclusive, short by)
     
    static boolean[]
    repeat(boolean element, int n)
     
    static byte[]
    repeat(byte element, int n)
     
    static char[]
    repeat(char element, int n)
     
    static double[]
    repeat(double element, int n)
     
    static float[]
    repeat(float element, int n)
     
    static int[]
    repeat(int element, int n)
     
    static long[]
    repeat(long element, int n)
     
    static short[]
    repeat(short element, int n)
     
    static String[]
    repeat(String element, int n)
     
    static <T> T[]
    repeat(T element, int n)
    Deprecated.
    prefer to repeat(Object, int, Class) because this method throws NullPointerException when element is null
    static <T> T[]
    repeat(T element, int n, Class<? extends T> elementClass)
     
    static <T> T[]
    repeatNonNull(T element, int n)
     
    static void
    set(Object array, int index, Object value)
     
    static void
    setBoolean(Object array, int index, boolean z)
    Sets the boolean.
    static void
    setByte(Object array, int index, byte b)
    Sets the byte.
    static void
    setChar(Object array, int index, char c)
    Sets the char.
    static void
    setDouble(Object array, int index, double d)
    Sets the double.
    static void
    setFloat(Object array, int index, float f)
    Sets the float.
    static void
    setInt(Object array, int index, int i)
    Sets the int.
    static void
    setLong(Object array, int index, long l)
    Sets the long.
    static void
    setShort(Object array, int index, short s)
    Sets the short.
    static boolean[]
    unbox(Boolean... a)
    Converts an array of object Booleans to primitives.
    static boolean[][]
    unbox(Boolean[][] a)
     
    static boolean[][][]
    unbox(Boolean[][][] a)
     
    static boolean[][][]
    unbox(Boolean[][][] a, boolean valueForNull)
     
    static boolean[][]
    unbox(Boolean[][] a, boolean valueForNull)
     
    static boolean[]
    unbox(Boolean[] a, boolean valueForNull)
    Converts an array of object Booleans to primitives handling null.
    static boolean[]
    unbox(Boolean[] a, int fromIndex, int toIndex, boolean valueForNull)
     
    static byte[]
    unbox(Byte... a)
    Converts an array of object Bytes to primitives.
    static byte[][]
    unbox(Byte[][] a)
     
    static byte[][][]
    unbox(Byte[][][] a)
     
    static byte[][][]
    unbox(Byte[][][] a, byte valueForNull)
     
    static byte[][]
    unbox(Byte[][] a, byte valueForNull)
     
    static byte[]
    unbox(Byte[] a, byte valueForNull)
    Converts an array of object Bytes to primitives handling null.
    static byte[]
    unbox(Byte[] a, int fromIndex, int toIndex, byte valueForNull)
     
    static char[]
    Converts an array of object Characters to primitives.
    static char[][]
     
    static char[][][]
    unbox(Character[][][] a)
     
    static char[][][]
    unbox(Character[][][] a, char valueForNull)
     
    static char[][]
    unbox(Character[][] a, char valueForNull)
     
    static char[]
    unbox(Character[] a, char valueForNull)
    Converts an array of object Character to primitives handling null .
    static char[]
    unbox(Character[] a, int fromIndex, int toIndex, char valueForNull)
     
    static double[]
    unbox(Double... a)
    Converts an array of object Doubles to primitives.
    static double[][]
    unbox(Double[][] a)
     
    static double[][][]
    unbox(Double[][][] a)
     
    static double[][][]
    unbox(Double[][][] a, double valueForNull)
     
    static double[][]
    unbox(Double[][] a, double valueForNull)
     
    static double[]
    unbox(Double[] a, double valueForNull)
    Converts an array of object Doubles to primitives handling null.
    static double[]
    unbox(Double[] a, int fromIndex, int toIndex, double valueForNull)
     
    static float[]
    unbox(Float... a)
    Converts an array of object Floats to primitives.
    static float[][]
    unbox(Float[][] a)
     
    static float[][][]
    unbox(Float[][][] a)
     
    static float[][][]
    unbox(Float[][][] a, float valueForNull)
     
    static float[][]
    unbox(Float[][] a, float valueForNull)
     
    static float[]
    unbox(Float[] a, float valueForNull)
    Converts an array of object Floats to primitives handling null.
    static float[]
    unbox(Float[] a, int fromIndex, int toIndex, float valueForNull)
     
    static int[]
    unbox(Integer... a)
    Converts an array of object Integers to primitives.
    static int[][]
    unbox(Integer[][] a)
     
    static int[][][]
    unbox(Integer[][][] a)
     
    static int[][][]
    unbox(Integer[][][] a, int valueForNull)
     
    static int[][]
    unbox(Integer[][] a, int valueForNull)
     
    static int[]
    unbox(Integer[] a, int valueForNull)
    Converts an array of object Integer to primitives handling null.
    static int[]
    unbox(Integer[] a, int fromIndex, int toIndex, int valueForNull)
     
    static long[]
    unbox(Long... a)
    Converts an array of object Longs to primitives.
    static long[][]
    unbox(Long[][] a)
     
    static long[][][]
    unbox(Long[][][] a)
     
    static long[][][]
    unbox(Long[][][] a, long valueForNull)
     
    static long[][]
    unbox(Long[][] a, long valueForNull)
     
    static long[]
    unbox(Long[] a, int fromIndex, int toIndex, long valueForNull)
     
    static long[]
    unbox(Long[] a, long valueForNull)
    Converts an array of object Long to primitives handling null.
    static short[]
    unbox(Short... a)
    Converts an array of object Shorts to primitives.
    static short[][]
    unbox(Short[][] a)
     
    static short[][][]
    unbox(Short[][][] a)
     
    static short[][][]
    unbox(Short[][][] a, short valueForNull)
     
    static short[][]
    unbox(Short[][] a, short valueForNull)
     
    static short[]
    unbox(Short[] a, int fromIndex, int toIndex, short valueForNull)
     
    static short[]
    unbox(Short[] a, short valueForNull)
    Converts an array of object Short to primitives handling null.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • newInstance

      public static <T> T newInstance(Class<?> componentType, int length) throws NegativeArraySizeException
      Type Parameters:
      T -
      Parameters:
      componentType -
      length -
      Returns:
      Throws:
      NegativeArraySizeException - the negative array size exception
    • newInstance

      @SafeVarargs public static <T> T newInstance(Class<?> componentType, int... dimensions) throws IllegalArgumentException, NegativeArraySizeException
      Type Parameters:
      T -
      Parameters:
      componentType -
      dimensions -
      Returns:
      Throws:
      IllegalArgumentException - the illegal argument exception
      NegativeArraySizeException - the negative array size exception
    • getLength

      public static int getLength(Object array) throws IllegalArgumentException
      Gets the length.
      Parameters:
      array -
      Returns:
      Throws:
      IllegalArgumentException - the illegal argument exception
    • get

      public static <T> T get(Object array, int index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException
      Type Parameters:
      T -
      Parameters:
      array -
      index -
      Returns:
      Throws:
      IllegalArgumentException - the illegal argument exception
      ArrayIndexOutOfBoundsException - the array index out of bounds exception
    • getBoolean

      public static boolean getBoolean(Object array, int index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException
      Gets the boolean.
      Parameters:
      array -
      index -
      Returns:
      Throws:
      IllegalArgumentException - the illegal argument exception
      ArrayIndexOutOfBoundsException - the array index out of bounds exception
    • getByte

      public static byte getByte(Object array, int index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException
      Gets the byte.
      Parameters:
      array -
      index -
      Returns:
      Throws:
      IllegalArgumentException - the illegal argument exception
      ArrayIndexOutOfBoundsException - the array index out of bounds exception
    • getChar

      public static char getChar(Object array, int index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException
      Gets the char.
      Parameters:
      array -
      index -
      Returns:
      Throws:
      IllegalArgumentException - the illegal argument exception
      ArrayIndexOutOfBoundsException - the array index out of bounds exception
    • getShort

      public static short getShort(Object array, int index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException
      Gets the short.
      Parameters:
      array -
      index -
      Returns:
      Throws:
      IllegalArgumentException - the illegal argument exception
      ArrayIndexOutOfBoundsException - the array index out of bounds exception
    • getInt

      public static int getInt(Object array, int index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException
      Gets the int.
      Parameters:
      array -
      index -
      Returns:
      Throws:
      IllegalArgumentException - the illegal argument exception
      ArrayIndexOutOfBoundsException - the array index out of bounds exception
    • getLong

      public static long getLong(Object array, int index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException
      Gets the long.
      Parameters:
      array -
      index -
      Returns:
      Throws:
      IllegalArgumentException - the illegal argument exception
      ArrayIndexOutOfBoundsException - the array index out of bounds exception
    • getFloat

      public static float getFloat(Object array, int index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException
      Gets the float.
      Parameters:
      array -
      index -
      Returns:
      Throws:
      IllegalArgumentException - the illegal argument exception
      ArrayIndexOutOfBoundsException - the array index out of bounds exception
    • getDouble

      public static double getDouble(Object array, int index) throws IllegalArgumentException, ArrayIndexOutOfBoundsException
      Gets the double.
      Parameters:
      array -
      index -
      Returns:
      Throws:
      IllegalArgumentException - the illegal argument exception
      ArrayIndexOutOfBoundsException - the array index out of bounds exception
    • set

      public static void set(Object array, int index, Object value) throws IllegalArgumentException, ArrayIndexOutOfBoundsException
      Parameters:
      array -
      index -
      value -
      Throws:
      IllegalArgumentException - the illegal argument exception
      ArrayIndexOutOfBoundsException - the array index out of bounds exception
    • setBoolean

      public static void setBoolean(Object array, int index, boolean z) throws IllegalArgumentException, ArrayIndexOutOfBoundsException
      Sets the boolean.
      Parameters:
      array -
      index -
      z -
      Throws:
      IllegalArgumentException - the illegal argument exception
      ArrayIndexOutOfBoundsException - the array index out of bounds exception
    • setByte

      public static void setByte(Object array, int index, byte b) throws IllegalArgumentException, ArrayIndexOutOfBoundsException
      Sets the byte.
      Parameters:
      array -
      index -
      b -
      Throws:
      IllegalArgumentException - the illegal argument exception
      ArrayIndexOutOfBoundsException - the array index out of bounds exception
    • setChar

      public static void setChar(Object array, int index, char c) throws IllegalArgumentException, ArrayIndexOutOfBoundsException
      Sets the char.
      Parameters:
      array -
      index -
      c -
      Throws:
      IllegalArgumentException - the illegal argument exception
      ArrayIndexOutOfBoundsException - the array index out of bounds exception
    • setShort

      public static void setShort(Object array, int index, short s) throws IllegalArgumentException, ArrayIndexOutOfBoundsException
      Sets the short.
      Parameters:
      array -
      index -
      s -
      Throws:
      IllegalArgumentException - the illegal argument exception
      ArrayIndexOutOfBoundsException - the array index out of bounds exception
    • setInt

      public static void setInt(Object array, int index, int i) throws IllegalArgumentException, ArrayIndexOutOfBoundsException
      Sets the int.
      Parameters:
      array -
      index -
      i -
      Throws:
      IllegalArgumentException - the illegal argument exception
      ArrayIndexOutOfBoundsException - the array index out of bounds exception
    • setLong

      public static void setLong(Object array, int index, long l) throws IllegalArgumentException, ArrayIndexOutOfBoundsException
      Sets the long.
      Parameters:
      array -
      index -
      l -
      Throws:
      IllegalArgumentException - the illegal argument exception
      ArrayIndexOutOfBoundsException - the array index out of bounds exception
    • setFloat

      public static void setFloat(Object array, int index, float f) throws IllegalArgumentException, ArrayIndexOutOfBoundsException
      Sets the float.
      Parameters:
      array -
      index -
      f -
      Throws:
      IllegalArgumentException - the illegal argument exception
      ArrayIndexOutOfBoundsException - the array index out of bounds exception
    • setDouble

      public static void setDouble(Object array, int index, double d) throws IllegalArgumentException, ArrayIndexOutOfBoundsException
      Sets the double.
      Parameters:
      array -
      index -
      d -
      Throws:
      IllegalArgumentException - the illegal argument exception
      ArrayIndexOutOfBoundsException - the array index out of bounds exception
    • asList

      @SafeVarargs @NullSafe public static <T> List<T> asList(T... a)
      Returns a fixed-size list backed by the specified array if it's not null or empty, otherwise an immutable empty list is returned.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
      See Also:
    • of

      @SafeVarargs public static boolean[] of(boolean... a)
      Returns the input array.
      Parameters:
      a -
      Returns:
    • of

      @SafeVarargs public static char[] of(char... a)
      Returns the input array.
      Parameters:
      a -
      Returns:
    • of

      @SafeVarargs public static byte[] of(byte... a)
      Returns the input array.
      Parameters:
      a -
      Returns:
    • of

      @SafeVarargs public static short[] of(short... a)
      Returns the input array.
      Parameters:
      a -
      Returns:
    • of

      @SafeVarargs public static int[] of(int... a)
      Returns the input array.
      Parameters:
      a -
      Returns:
    • of

      @SafeVarargs public static long[] of(long... a)
      Returns the input array.
      Parameters:
      a -
      Returns:
    • of

      @SafeVarargs public static float[] of(float... a)
      Returns the input array.
      Parameters:
      a -
      Returns:
    • of

      @SafeVarargs public static double[] of(double... a)
      Returns the input array.
      Parameters:
      a -
      Returns:
    • of

      @SafeVarargs public static String[] of(String... a)
      Returns the input array.
      Parameters:
      a -
      Returns:
    • of

      @SafeVarargs public static <T extends Date> T[] of(T... a)
      Returns the input array.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • of

      @SafeVarargs public static <T extends Calendar> T[] of(T... a)
      Returns the input array.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • of

      @SafeVarargs public static <T extends Temporal> T[] of(T... a)
      Returns the input array.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • oF

      @Deprecated @SafeVarargs public static <T> T[] oF(T... a)
      Deprecated.
      please use N.asArray(Object...).
      Returns the input array.
      Type Parameters:
      T -
      Parameters:
      a -
      Returns:
    • range

      public static char[] range(char startInclusive, char endExclusive)
      Parameters:
      startInclusive -
      endExclusive -
      Returns:
    • range

      public static byte[] range(byte startInclusive, byte endExclusive)
      Parameters:
      startInclusive -
      endExclusive -
      Returns:
    • range

      public static short[] range(short startInclusive, short endExclusive)
      Parameters:
      startInclusive -
      endExclusive -
      Returns:
    • range

      public static int[] range(int startInclusive, int endExclusive)
      Parameters:
      startInclusive -
      endExclusive -
      Returns:
    • range

      public static long[] range(long startInclusive, long endExclusive)
      Parameters:
      startInclusive -
      endExclusive -
      Returns:
    • range

      public static char[] range(char startInclusive, char endExclusive, int by)
      Parameters:
      startInclusive -
      endExclusive -
      by -
      Returns:
    • range

      public static byte[] range(byte startInclusive, byte endExclusive, byte by)
      Parameters:
      startInclusive -
      endExclusive -
      by -
      Returns:
    • range

      public static short[] range(short startInclusive, short endExclusive, short by)
      Parameters:
      startInclusive -
      endExclusive -
      by -
      Returns:
    • range

      public static int[] range(int startInclusive, int endExclusive, int by)
      Parameters:
      startInclusive -
      endExclusive -
      by -
      Returns:
    • range

      public static long[] range(long startInclusive, long endExclusive, long by)
      Parameters:
      startInclusive -
      endExclusive -
      by -
      Returns:
    • rangeClosed

      public static char[] rangeClosed(char startInclusive, char endInclusive)
      Parameters:
      startInclusive -
      endInclusive -
      Returns:
    • rangeClosed

      public static byte[] rangeClosed(byte startInclusive, byte endInclusive)
      Parameters:
      startInclusive -
      endInclusive -
      Returns:
    • rangeClosed

      public static short[] rangeClosed(short startInclusive, short endInclusive)
      Parameters:
      startInclusive -
      endInclusive -
      Returns:
    • rangeClosed

      public static int[] rangeClosed(int startInclusive, int endInclusive)
      Parameters:
      startInclusive -
      endInclusive -
      Returns:
    • rangeClosed

      public static long[] rangeClosed(long startInclusive, long endInclusive)
      Parameters:
      startInclusive -
      endInclusive -
      Returns:
    • rangeClosed

      public static char[] rangeClosed(char startInclusive, char endInclusive, int by)
      Parameters:
      startInclusive -
      endInclusive -
      by -
      Returns:
    • rangeClosed

      public static byte[] rangeClosed(byte startInclusive, byte endInclusive, byte by)
      Parameters:
      startInclusive -
      endInclusive -
      by -
      Returns:
    • rangeClosed

      public static short[] rangeClosed(short startInclusive, short endInclusive, short by)
      Parameters:
      startInclusive -
      endInclusive -
      by -
      Returns:
    • rangeClosed

      public static int[] rangeClosed(int startInclusive, int endInclusive, int by)
      Parameters:
      startInclusive -
      endInclusive -
      by -
      Returns:
    • rangeClosed

      public static long[] rangeClosed(long startInclusive, long endInclusive, long by)
      Parameters:
      startInclusive -
      endInclusive -
      by -
      Returns:
    • repeat

      public static boolean[] repeat(boolean element, int n)
      Parameters:
      element -
      n -
      Returns:
    • repeat

      public static char[] repeat(char element, int n)
      Parameters:
      element -
      n -
      Returns:
    • repeat

      public static byte[] repeat(byte element, int n)
      Parameters:
      element -
      n -
      Returns:
    • repeat

      public static short[] repeat(short element, int n)
      Parameters:
      element -
      n -
      Returns:
    • repeat

      public static int[] repeat(int element, int n)
      Parameters:
      element -
      n -
      Returns:
    • repeat

      public static long[] repeat(long element, int n)
      Parameters:
      element -
      n -
      Returns:
    • repeat

      public static float[] repeat(float element, int n)
      Parameters:
      element -
      n -
      Returns:
    • repeat

      public static double[] repeat(double element, int n)
      Parameters:
      element -
      n -
      Returns:
    • repeat

      public static String[] repeat(String element, int n)
      Parameters:
      element -
      n -
      Returns:
    • repeat

      @Deprecated public static <T> T[] repeat(T element, int n) throws NullPointerException
      Deprecated.
      prefer to repeat(Object, int, Class) because this method throws NullPointerException when element is null
      Type Parameters:
      T -
      Parameters:
      element -
      n -
      Returns:
      Throws:
      NullPointerException - if the specified element is null.
      See Also:
    • repeat

      public static <T> T[] repeat(T element, int n, Class<? extends T> elementClass) throws NullPointerException
      Type Parameters:
      T -
      Parameters:
      element -
      n -
      elementClass -
      Returns:
      Throws:
      NullPointerException
    • repeatNonNull

      public static <T> T[] repeatNonNull(T element, int n) throws IllegalArgumentException
      Type Parameters:
      T -
      Parameters:
      element -
      n -
      Returns:
      Throws:
      IllegalArgumentException - if the specified element is null.
    • concat

      public static boolean[][] concat(boolean[][] a, boolean[][] b)
      Parameters:
      a -
      b -
      Returns:
    • concat

      public static boolean[][][] concat(boolean[][][] a, boolean[][][] b)
      Parameters:
      a -
      b -
      Returns:
    • concat

      public static char[][] concat(char[][] a, char[][] b)
      Parameters:
      a -
      b -
      Returns:
    • concat

      public static char[][][] concat(char[][][] a, char[][][] b)
      Parameters:
      a -
      b -
      Returns:
    • concat

      public static byte[][] concat(byte[][] a, byte[][] b)
      Parameters:
      a -
      b -
      Returns:
    • concat

      public static byte[][][] concat(byte[][][] a, byte[][][] b)
      Parameters:
      a -
      b -
      Returns:
    • concat

      public static short[][] concat(short[][] a, short[][] b)
      Parameters:
      a -
      b -
      Returns:
    • concat

      public static short[][][] concat(short[][][] a, short[][][] b)
      Parameters:
      a -
      b -
      Returns:
    • concat

      public static int[][] concat(int[][] a, int[][] b)
      Parameters:
      a -
      b -
      Returns:
    • concat

      public static int[][][] concat(int[][][] a, int[][][] b)
      Parameters:
      a -
      b -
      Returns:
    • concat

      public static long[][] concat(long[][] a, long[][] b)
      Parameters:
      a -
      b -
      Returns:
    • concat

      public static long[][][] concat(long[][][] a, long[][][] b)
      Parameters:
      a -
      b -
      Returns:
    • concat

      public static float[][] concat(float[][] a, float[][] b)
      Parameters:
      a -
      b -
      Returns:
    • concat

      public static float[][][] concat(float[][][] a, float[][][] b)
      Parameters:
      a -
      b -
      Returns:
    • concat

      public static double[][] concat(double[][] a, double[][] b)
      Parameters:
      a -
      b -
      Returns:
    • concat

      public static double[][][] concat(double[][][] a, double[][][] b)
      Parameters:
      a -
      b -
      Returns:
    • concatt

      public static <T> T[][] concatt(T[][] a, T[][] b)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
    • concatt

      public static <T> T[][][] concatt(T[][][] a, T[][][] b)
      Type Parameters:
      T -
      Parameters:
      a -
      b -
      Returns:
    • box

      @SafeVarargs public static Boolean[] box(boolean... a)

      Converts an array of primitive booleans to objects.

      This method returns null for a null input array.

      Parameters:
      a - a boolean array
      Returns:
      a Boolean array, null if null array input
    • box

      public static Boolean[] box(boolean[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • box

      @SafeVarargs public static Character[] box(char... a)

      Converts an array of primitive chars to objects.

      This method returns null for a null input array.

      Parameters:
      a - a char array
      Returns:
      a Character array, null if null array input
    • box

      public static Character[] box(char[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • box

      @SafeVarargs public static Byte[] box(byte... a)

      Converts an array of primitive bytes to objects.

      This method returns null for a null input array.

      Parameters:
      a - a byte array
      Returns:
      a Byte array, null if null array input
    • box

      public static Byte[] box(byte[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • box

      @SafeVarargs public static Short[] box(short... a)

      Converts an array of primitive shorts to objects.

      This method returns null for a null input array.

      Parameters:
      a - a short array
      Returns:
      a Short array, null if null array input
    • box

      public static Short[] box(short[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • box

      @SafeVarargs public static Integer[] box(int... a)

      Converts an array of primitive ints to objects.

      This method returns null for a null input array.

      Parameters:
      a - an int array
      Returns:
      an Integer array, null if null array input
    • box

      public static Integer[] box(int[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • box

      @SafeVarargs public static Long[] box(long... a)

      Converts an array of primitive longs to objects.

      This method returns null for a null input array.

      Parameters:
      a - a long array
      Returns:
      a Long array, null if null array input
    • box

      public static Long[] box(long[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • box

      @SafeVarargs public static Float[] box(float... a)

      Converts an array of primitive floats to objects.

      This method returns null for a null input array.

      Parameters:
      a - a float array
      Returns:
      a Float array, null if null array input
    • box

      public static Float[] box(float[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • box

      @SafeVarargs public static Double[] box(double... a)

      Converts an array of primitive doubles to objects.

      This method returns null for a null input array.

      Parameters:
      a - a double array
      Returns:
      a Double array, null if null array input
    • box

      public static Double[] box(double[] a, int fromIndex, int toIndex)
      Parameters:
      a -
      fromIndex -
      toIndex -
      Returns:
    • box

      public static Boolean[][] box(boolean[][] a)
      Parameters:
      a -
      Returns:
    • box

      public static Character[][] box(char[][] a)
      Parameters:
      a -
      Returns:
    • box

      public static Byte[][] box(byte[][] a)
      Parameters:
      a -
      Returns:
    • box

      public static Short[][] box(short[][] a)
      Parameters:
      a -
      Returns:
    • box

      public static Integer[][] box(int[][] a)
      Parameters:
      a -
      Returns:
    • box

      public static Long[][] box(long[][] a)
      Parameters:
      a -
      Returns:
    • box

      public static Float[][] box(float[][] a)
      Parameters:
      a -
      Returns:
    • box

      public static Double[][] box(double[][] a)
      Parameters:
      a -
      Returns:
    • box

      public static Boolean[][][] box(boolean[][][] a)
      Parameters:
      a -
      Returns:
    • box

      public static Character[][][] box(char[][][] a)
      Parameters:
      a -
      Returns:
    • box

      public static Byte[][][] box(byte[][][] a)
      Parameters:
      a -
      Returns:
    • box

      public static Short[][][] box(short[][][] a)
      Parameters:
      a -
      Returns:
    • box

      public static Integer[][][] box(int[][][] a)
      Parameters:
      a -
      Returns:
    • box

      public static Long[][][] box(long[][][] a)
      Parameters:
      a -
      Returns:
    • box

      public static Float[][][] box(float[][][] a)
      Parameters:
      a -
      Returns:
    • box

      public static Double[][][] box(double[][][] a)
      Parameters:
      a -
      Returns:
    • unbox

      @SafeVarargs public static boolean[] unbox(Boolean... a)

      Converts an array of object Booleans to primitives.

      This method returns null for a null input array.

      Parameters:
      a - a Boolean array, may be null
      Returns:
      a boolean array, null if null array input
    • unbox

      public static boolean[] unbox(Boolean[] a, boolean valueForNull)

      Converts an array of object Booleans to primitives handling null.

      This method returns null for a null input array.

      Parameters:
      a - a Boolean array, may be null
      valueForNull - the value to insert if null found
      Returns:
      a boolean array, null if null array input
    • unbox

      public static boolean[] unbox(Boolean[] a, int fromIndex, int toIndex, boolean valueForNull)
      Parameters:
      a -
      fromIndex -
      toIndex -
      valueForNull -
      Returns:
    • unbox

      @SafeVarargs public static char[] unbox(Character... a)

      Converts an array of object Characters to primitives.

      This method returns null for a null input array.

      Parameters:
      a - a Character array, may be null
      Returns:
      a char array, null if null array input
    • unbox

      public static char[] unbox(Character[] a, char valueForNull)

      Converts an array of object Character to primitives handling null .

      This method returns null for a null input array.

      Parameters:
      a - a Character array, may be null
      valueForNull - the value to insert if null found
      Returns:
      a char array, null if null array input
    • unbox

      public static char[] unbox(Character[] a, int fromIndex, int toIndex, char valueForNull)
      Parameters:
      a -
      fromIndex -
      toIndex -
      valueForNull -
      Returns:
    • unbox

      @SafeVarargs public static byte[] unbox(Byte... a)

      Converts an array of object Bytes to primitives.

      This method returns null for a null input array.

      Parameters:
      a - a Byte array, may be null
      Returns:
      a byte array, null if null array input
    • unbox

      public static byte[] unbox(Byte[] a, byte valueForNull)

      Converts an array of object Bytes to primitives handling null.

      This method returns null for a null input array.

      Parameters:
      a - a Byte array, may be null
      valueForNull - the value to insert if null found
      Returns:
      a byte array, null if null array input
    • unbox

      public static byte[] unbox(Byte[] a, int fromIndex, int toIndex, byte valueForNull)
      Parameters:
      a -
      fromIndex -
      toIndex -
      valueForNull -
      Returns:
    • unbox

      @SafeVarargs public static short[] unbox(Short... a)

      Converts an array of object Shorts to primitives.

      This method returns null for a null input array.

      Parameters:
      a - a Short array, may be null
      Returns:
      a byte array, null if null array input
    • unbox

      public static short[] unbox(Short[] a, short valueForNull)

      Converts an array of object Short to primitives handling null.

      This method returns null for a null input array.

      Parameters:
      a - a Short array, may be null
      valueForNull - the value to insert if null found
      Returns:
      a byte array, null if null array input
    • unbox

      public static short[] unbox(Short[] a, int fromIndex, int toIndex, short valueForNull)
      Parameters:
      a -
      fromIndex -
      toIndex -
      valueForNull -
      Returns:
    • unbox

      @SafeVarargs public static int[] unbox(Integer... a)

      Converts an array of object Integers to primitives.

      This method returns null for a null input array.

      Parameters:
      a - a Integer array, may be null
      Returns:
      an int array, null if null array input
    • unbox

      public static int[] unbox(Integer[] a, int valueForNull)

      Converts an array of object Integer to primitives handling null.

      This method returns null for a null input array.

      Parameters:
      a - a Integer array, may be null
      valueForNull - the value to insert if null found
      Returns:
      an int array, null if null array input
    • unbox

      public static int[] unbox(Integer[] a, int fromIndex, int toIndex, int valueForNull)
      Parameters:
      a -
      fromIndex -
      toIndex -
      valueForNull -
      Returns:
    • unbox

      @SafeVarargs public static long[] unbox(Long... a)

      Converts an array of object Longs to primitives.

      This method returns null for a null input array.

      Parameters:
      a - a Long array, may be null
      Returns:
      a long array, null if null array input
    • unbox

      public static long[] unbox(Long[] a, long valueForNull)

      Converts an array of object Long to primitives handling null.

      This method returns null for a null input array.

      Parameters:
      a - a Long array, may be null
      valueForNull - the value to insert if null found
      Returns:
      a long array, null if null array input
    • unbox

      public static long[] unbox(Long[] a, int fromIndex, int toIndex, long valueForNull)
      Parameters:
      a -
      fromIndex -
      toIndex -
      valueForNull -
      Returns:
    • unbox

      @SafeVarargs public static float[] unbox(Float... a)

      Converts an array of object Floats to primitives.

      This method returns null for a null input array.

      Parameters:
      a - a Float array, may be null
      Returns:
      a float array, null if null array input
    • unbox

      public static float[] unbox(Float[] a, float valueForNull)

      Converts an array of object Floats to primitives handling null.

      This method returns null for a null input array.

      Parameters:
      a - a Float array, may be null
      valueForNull - the value to insert if null found
      Returns:
      a float array, null if null array input
    • unbox

      public static float[] unbox(Float[] a, int fromIndex, int toIndex, float valueForNull)
      Parameters:
      a -
      fromIndex -
      toIndex -
      valueForNull -
      Returns:
    • unbox

      @SafeVarargs public static double[] unbox(Double... a)

      Converts an array of object Doubles to primitives.

      This method returns null for a null input array.

      Parameters:
      a - a Double array, may be null
      Returns:
      a double array, null if null array input
    • unbox

      public static double[] unbox(Double[] a, double valueForNull)

      Converts an array of object Doubles to primitives handling null.

      This method returns null for a null input array.

      Parameters:
      a - a Double array, may be null
      valueForNull - the value to insert if null found
      Returns:
      a double array, null if null array input
    • unbox

      public static double[] unbox(Double[] a, int fromIndex, int toIndex, double valueForNull)
      Parameters:
      a -
      fromIndex -
      toIndex -
      valueForNull -
      Returns:
    • unbox

      public static boolean[][] unbox(Boolean[][] a)
      Parameters:
      a -
      Returns:
    • unbox

      public static boolean[][] unbox(Boolean[][] a, boolean valueForNull)
      Parameters:
      a -
      valueForNull -
      Returns:
    • unbox

      public static char[][] unbox(Character[][] a)
      Parameters:
      a -
      Returns:
    • unbox

      public static char[][] unbox(Character[][] a, char valueForNull)
      Parameters:
      a -
      valueForNull -
      Returns:
    • unbox

      public static byte[][] unbox(Byte[][] a)
      Parameters:
      a -
      Returns:
    • unbox

      public static byte[][] unbox(Byte[][] a, byte valueForNull)
      Parameters:
      a -
      valueForNull -
      Returns:
    • unbox

      public static short[][] unbox(Short[][] a)
      Parameters:
      a -
      Returns:
    • unbox

      public static short[][] unbox(Short[][] a, short valueForNull)
      Parameters:
      a -
      valueForNull -
      Returns:
    • unbox

      public static int[][] unbox(Integer[][] a)
      Parameters:
      a -
      Returns:
    • unbox

      public static int[][] unbox(Integer[][] a, int valueForNull)
      Parameters:
      a -
      valueForNull -
      Returns:
    • unbox

      public static long[][] unbox(Long[][] a)
      Parameters:
      a -
      Returns:
    • unbox

      public static long[][] unbox(Long[][] a, long valueForNull)
      Parameters:
      a -
      valueForNull -
      Returns:
    • unbox

      public static float[][] unbox(Float[][] a)
      Parameters:
      a -
      Returns:
    • unbox

      public static float[][] unbox(Float[][] a, float valueForNull)
      Parameters:
      a -
      valueForNull -
      Returns:
    • unbox

      public static double[][] unbox(Double[][] a)
      Parameters:
      a -
      Returns:
    • unbox

      public static double[][] unbox(Double[][] a, double valueForNull)
      Parameters:
      a -
      valueForNull -
      Returns:
    • unbox

      public static boolean[][][] unbox(Boolean[][][] a)
      Parameters:
      a -
      Returns:
    • unbox

      public static boolean[][][] unbox(Boolean[][][] a, boolean valueForNull)
      Parameters:
      a -
      valueForNull -
      Returns:
    • unbox

      public static char[][][] unbox(Character[][][] a)
      Parameters:
      a -
      Returns:
    • unbox

      public static char[][][] unbox(Character[][][] a, char valueForNull)
      Parameters:
      a -
      valueForNull -
      Returns:
    • unbox

      public static byte[][][] unbox(Byte[][][] a)
      Parameters:
      a -
      Returns:
    • unbox

      public static byte[][][] unbox(Byte[][][] a, byte valueForNull)
      Parameters:
      a -
      valueForNull -
      Returns:
    • unbox

      public static short[][][] unbox(Short[][][] a)
      Parameters:
      a -
      Returns:
    • unbox

      public static short[][][] unbox(Short[][][] a, short valueForNull)
      Parameters:
      a -
      valueForNull -
      Returns:
    • unbox

      public static int[][][] unbox(Integer[][][] a)
      Parameters:
      a -
      Returns:
    • unbox

      public static int[][][] unbox(Integer[][][] a, int valueForNull)
      Parameters:
      a -
      valueForNull -
      Returns:
    • unbox

      public static long[][][] unbox(Long[][][] a)
      Parameters:
      a -
      Returns:
    • unbox

      public static long[][][] unbox(Long[][][] a, long valueForNull)
      Parameters:
      a -
      valueForNull -
      Returns:
    • unbox

      public static float[][][] unbox(Float[][][] a)
      Parameters:
      a -
      Returns:
    • unbox

      public static float[][][] unbox(Float[][][] a, float valueForNull)
      Parameters:
      a -
      valueForNull -
      Returns:
    • unbox

      public static double[][][] unbox(Double[][][] a)
      Parameters:
      a -
      Returns:
    • unbox

      public static double[][][] unbox(Double[][][] a, double valueForNull)
      Parameters:
      a -
      valueForNull -
      Returns: