程序包 cool.scx.util

类 ArrayUtils

java.lang.Object
cool.scx.util.ArrayUtils

public final class ArrayUtils extends Object
提供一些 Array 的方法, 也有一些 List 相关的方法
  • 构造器详细资料

    • ArrayUtils

      public ArrayUtils()
  • 方法详细资料

    • toPrimitive

      public static byte[] toPrimitive(Byte[] w)
    • toPrimitive

      public static short[] toPrimitive(Short[] w)
    • toPrimitive

      public static int[] toPrimitive(Integer[] w)
    • toPrimitive

      public static long[] toPrimitive(Long[] w)
    • toPrimitive

      public static float[] toPrimitive(Float[] w)
    • toPrimitive

      public static double[] toPrimitive(Double[] w)
    • toPrimitive

      public static boolean[] toPrimitive(Boolean[] w)
    • toPrimitive

      public static char[] toPrimitive(Character[] w)
    • toWrapper

      public static Byte[] toWrapper(byte[] p)
    • toWrapper

      public static Short[] toWrapper(short[] p)
    • toWrapper

      public static Integer[] toWrapper(int[] p)
    • toWrapper

      public static Long[] toWrapper(long[] p)
    • toWrapper

      public static Float[] toWrapper(float[] p)
    • toWrapper

      public static Double[] toWrapper(double[] p)
    • toWrapper

      public static Boolean[] toWrapper(boolean[] p)
    • toWrapper

      public static Character[] toWrapper(char[] p)
    • swap

      public static void swap(byte[] arr, int i, int j)
    • swap

      public static void swap(short[] arr, int i, int j)
    • swap

      public static void swap(int[] arr, int i, int j)
    • swap

      public static void swap(long[] arr, int i, int j)
    • swap

      public static void swap(float[] arr, int i, int j)
    • swap

      public static void swap(double[] arr, int i, int j)
    • swap

      public static void swap(boolean[] arr, int i, int j)
    • swap

      public static void swap(char[] arr, int i, int j)
    • swap

      public static void swap(Object[] arr, int i, int j)
    • shuffle

      public static void shuffle(byte[] arr)
    • shuffle

      public static void shuffle(short[] arr)
    • shuffle

      public static void shuffle(int[] arr)
    • shuffle

      public static void shuffle(long[] arr)
    • shuffle

      public static void shuffle(float[] arr)
    • shuffle

      public static void shuffle(double[] arr)
    • shuffle

      public static void shuffle(boolean[] arr)
    • shuffle

      public static void shuffle(char[] arr)
    • shuffle

      public static void shuffle(Object[] arr)
    • indexOf

      public static int indexOf(byte[] a, byte[] a1)
    • indexOf

      public static int indexOf(short[] a, short[] a1)
    • indexOf

      public static int indexOf(int[] a, int[] a1)
    • indexOf

      public static int indexOf(long[] a, long[] a1)
    • indexOf

      public static int indexOf(float[] a, float[] a1)
    • indexOf

      public static int indexOf(double[] a, double[] a1)
    • indexOf

      public static int indexOf(boolean[] a, boolean[] a1)
    • indexOf

      public static int indexOf(char[] a, char[] a1)
    • indexOf

      public static int indexOf(Object[] a, Object[] a1)
    • concat

      public static byte[] concat(byte[] first, byte[] second)
    • concat

      public static short[] concat(short[] first, short[] second)
    • concat

      public static int[] concat(int[] first, int[] second)
    • concat

      public static long[] concat(long[] first, long[] second)
    • concat

      public static float[] concat(float[] first, float[] second)
    • concat

      public static double[] concat(double[] first, double[] second)
    • concat

      public static boolean[] concat(boolean[] first, boolean[] second)
    • concat

      public static char[] concat(char[] first, char[] second)
    • concat

      public static <T> T[] concat(T[] first, T[] second)
    • splitArray

      public static byte[][] splitArray(byte[] arr, int sliceSize)
    • splitArray

      public static short[][] splitArray(short[] arr, int sliceSize)
    • splitArray

      public static int[][] splitArray(int[] arr, int sliceSize)
    • splitArray

      public static long[][] splitArray(long[] arr, int sliceSize)
    • splitArray

      public static float[][] splitArray(float[] arr, int sliceSize)
    • splitArray

      public static double[][] splitArray(double[] arr, int sliceSize)
    • splitArray

      public static boolean[][] splitArray(boolean[] arr, int sliceSize)
    • splitArray

      public static char[][] splitArray(char[] arr, int sliceSize)
    • splitArray

      public static <T> T[][] splitArray(T[] arr, int sliceSize)
    • splitList

      public static <T> List<List<T>> splitList(List<T> list, int size)
      按照指定长度切割 List, 注意和 splitListN(List, int)} 进行区分
      类型参数:
      T - T
      参数:
      list - list
      size - 每份的长度
      返回:
      切割后的 list
    • splitArrayN

      public static byte[][] splitArrayN(byte[] arr, int n)
    • splitArrayN

      public static short[][] splitArrayN(short[] arr, int n)
    • splitArrayN

      public static int[][] splitArrayN(int[] arr, int n)
    • splitArrayN

      public static long[][] splitArrayN(long[] arr, int n)
    • splitArrayN

      public static float[][] splitArrayN(float[] arr, int n)
    • splitArrayN

      public static double[][] splitArrayN(double[] arr, int n)
    • splitArrayN

      public static boolean[][] splitArrayN(boolean[] arr, int n)
    • splitArrayN

      public static char[][] splitArrayN(char[] arr, int n)
    • splitArrayN

      public static <T> T[][] splitArrayN(T[] arr, int n)
      按照指定份数切割 List, 注意和 splitList(List, int) 进行区分
      类型参数:
      T - T
      参数:
      arr - arr
      n - 份数
      返回:
      切割后的 list
    • splitListN

      public static <T> List<List<T>> splitListN(List<T> list, int n)
      按照指定份数切割 List, 注意和 splitList(List, int) 进行区分
      类型参数:
      T - T
      参数:
      list - list
      n - 份数
      返回:
      切割后的 list
    • toObjectArray

      public static Object[] toObjectArray(Object source)
    • toLongArray

      public static long[] toLongArray(int[] intArray)
    • numOfSlices

      public static int numOfSlices(int length, int n)
      计算 长度可以被分割为几个子长度 (向上取整)
      参数:
      length - l
      n - n
      返回:
      c