类 ArrayUtils
java.lang.Object
cool.scx.common.util.ArrayUtils
提供一些 Array 的方法, 也有一些 List 相关的方法
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明static boolean[]concat(boolean[] first, boolean[] second) static byte[]concat(byte[] first, byte[] second) static char[]concat(char[] first, char[] second) static double[]concat(double[] first, double[] second) static float[]concat(float[] first, float[] second) static int[]concat(int[] first, int[] second) static long[]concat(long[] first, long[] second) static short[]concat(short[] first, short[] second) static <T> T[]concat(T[] first, T[] second) static intindexOf(boolean[] a, boolean[] a1) static intindexOf(byte[] a, byte[] a1) static intindexOf(char[] a, char[] a1) static intindexOf(double[] a, double[] a1) static intindexOf(float[] a, float[] a1) static intindexOf(int[] a, int[] a1) static intindexOf(long[] a, long[] a1) static intindexOf(short[] a, short[] a1) static intstatic intnumOfSlices(int length, int n) 计算 长度可以被分割为几个子长度 (向上取整)static voidreverse(boolean[] arr) static voidreverse(byte[] arr) static voidreverse(char[] arr) static voidreverse(double[] arr) static voidreverse(float[] arr) static voidreverse(int[] arr) static voidreverse(long[] arr) static voidreverse(short[] arr) static voidstatic voidshuffle(boolean[] arr) static voidshuffle(byte[] arr) static voidshuffle(char[] arr) static voidshuffle(double[] arr) static voidshuffle(float[] arr) static voidshuffle(int[] arr) static voidshuffle(long[] arr) static voidshuffle(short[] arr) static voidstatic boolean[][]splitArray(boolean[] arr, int sliceSize) static byte[][]splitArray(byte[] arr, int sliceSize) static char[][]splitArray(char[] arr, int sliceSize) static double[][]splitArray(double[] arr, int sliceSize) static float[][]splitArray(float[] arr, int sliceSize) static int[][]splitArray(int[] arr, int sliceSize) static long[][]splitArray(long[] arr, int sliceSize) static short[][]splitArray(short[] arr, int sliceSize) static <T> T[][]splitArray(T[] arr, int sliceSize) static boolean[][]splitArrayN(boolean[] arr, int n) static byte[][]splitArrayN(byte[] arr, int n) static char[][]splitArrayN(char[] arr, int n) static double[][]splitArrayN(double[] arr, int n) static float[][]splitArrayN(float[] arr, int n) static int[][]splitArrayN(int[] arr, int n) static long[][]splitArrayN(long[] arr, int n) static short[][]splitArrayN(short[] arr, int n) static <T> T[][]splitArrayN(T[] arr, int n) 按照指定份数切割 List, 注意和splitList(List, int)进行区分按照指定长度切割 List, 注意和splitListN(List, int)} 进行区分splitListN(List<T> list, int n) 按照指定份数切割 List, 注意和splitList(List, int)进行区分static voidswap(boolean[] arr, int i, int j) static voidswap(byte[] arr, int i, int j) static voidswap(char[] arr, int i, int j) static voidswap(double[] arr, int i, int j) static voidswap(float[] arr, int i, int j) static voidswap(int[] arr, int i, int j) static voidswap(long[] arr, int i, int j) static voidswap(short[] arr, int i, int j) static voidstatic long[]toLongArray(int[] intArray) static Object[]toObjectArray(Object source) static boolean[]toPrimitive(Boolean[] w) static byte[]toPrimitive(Byte[] w) static char[]toPrimitive(Character[] w) static double[]toPrimitive(Double[] w) static float[]toPrimitive(Float[] w) static int[]toPrimitive(Integer[] w) static long[]toPrimitive(Long[] w) static short[]toPrimitive(Short[] w) static Boolean[]toWrapper(boolean[] p) static Byte[]toWrapper(byte[] p) static Character[]toWrapper(char[] p) static Double[]toWrapper(double[] p) static Float[]toWrapper(float[] p) static Integer[]toWrapper(int[] p) static Long[]toWrapper(long[] p) static Short[]toWrapper(short[] p)
-
构造器详细资料
-
ArrayUtils
public ArrayUtils()
-
-
方法详细资料
-
toPrimitive
-
toPrimitive
-
toPrimitive
-
toPrimitive
-
toPrimitive
-
toPrimitive
-
toPrimitive
-
toPrimitive
-
toWrapper
-
toWrapper
-
toWrapper
-
toWrapper
-
toWrapper
-
toWrapper
-
toWrapper
-
toWrapper
-
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
-
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
-
reverse
public static void reverse(byte[] arr) -
reverse
public static void reverse(short[] arr) -
reverse
public static void reverse(int[] arr) -
reverse
public static void reverse(long[] arr) -
reverse
public static void reverse(float[] arr) -
reverse
public static void reverse(double[] arr) -
reverse
public static void reverse(boolean[] arr) -
reverse
public static void reverse(char[] arr) -
reverse
-
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
-
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
按照指定长度切割 List, 注意和splitListN(List, int)} 进行区分- 类型参数:
T- T- 参数:
list- listsize- 每份的长度- 返回:
- 切割后的 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- arrn- 份数- 返回:
- 切割后的 list
-
splitListN
按照指定份数切割 List, 注意和splitList(List, int)进行区分- 类型参数:
T- T- 参数:
list- listn- 份数- 返回:
- 切割后的 list
-
toObjectArray
-
toLongArray
public static long[] toLongArray(int[] intArray) -
numOfSlices
public static int numOfSlices(int length, int n) 计算 长度可以被分割为几个子长度 (向上取整)- 参数:
length- ln- n- 返回:
- c
-