public final class ArrayUtils
extends org.apache.commons.lang3.ArrayUtils
EMPTY_BOOLEAN_ARRAY, EMPTY_BOOLEAN_OBJECT_ARRAY, EMPTY_BYTE_ARRAY, EMPTY_BYTE_OBJECT_ARRAY, EMPTY_CHAR_ARRAY, EMPTY_CHARACTER_OBJECT_ARRAY, EMPTY_CLASS_ARRAY, EMPTY_DOUBLE_ARRAY, EMPTY_DOUBLE_OBJECT_ARRAY, EMPTY_FIELD_ARRAY, EMPTY_FLOAT_ARRAY, EMPTY_FLOAT_OBJECT_ARRAY, EMPTY_INT_ARRAY, EMPTY_INTEGER_OBJECT_ARRAY, EMPTY_LONG_ARRAY, EMPTY_LONG_OBJECT_ARRAY, EMPTY_METHOD_ARRAY, EMPTY_OBJECT_ARRAY, EMPTY_SHORT_ARRAY, EMPTY_SHORT_OBJECT_ARRAY, EMPTY_STRING_ARRAY, EMPTY_THROWABLE_ARRAY, EMPTY_TYPE_ARRAY, INDEX_NOT_FOUND| 构造器和说明 |
|---|
ArrayUtils() |
| 限定符和类型 | 方法和说明 |
|---|---|
static int |
allLength(String... strs)
所有元素的长度总和
|
static boolean[] |
fill(@NonNull boolean[] array,
int fromIndex,
int toIndex,
Object val)
填充,结束下标超出数组长度时,超出部分也填充
|
static byte[] |
fill(@NonNull byte[] array,
int fromIndex,
int toIndex,
Object val)
填充,结束下标超出数组长度时,超出部分也填充
|
static char[] |
fill(@NonNull char[] array,
int fromIndex,
int toIndex,
Object val)
填充,结束下标超出数组长度时,超出部分也填充
|
static double[] |
fill(@NonNull double[] array,
int fromIndex,
int toIndex,
Object val)
填充,结束下标超出数组长度时,超出部分也填充
|
static float[] |
fill(@NonNull float[] array,
int fromIndex,
int toIndex,
Object val)
填充,结束下标超出数组长度时,超出部分也填充
|
static int[] |
fill(@NonNull int[] array,
int fromIndex,
int toIndex,
Object val)
填充,结束下标超出数组长度时,超出部分也填充
|
static long[] |
fill(@NonNull long[] array,
int fromIndex,
int toIndex,
Object val)
填充,结束下标超出数组长度时,超出部分也填充
|
static short[] |
fill(@NonNull short[] array,
int fromIndex,
int toIndex,
Object val)
填充,结束下标超出数组长度时,超出部分也填充
|
static <T> T[] |
fill(T[] array,
int fromIndex,
int toIndex,
Object val)
填充,结束下标超出数组长度时,超出部分也填充
|
static int |
indexOf(@NonNull char[] chars,
@NonNull String valueToFind)
查找数组中指定的字符串
|
static int |
indexOf(@NonNull char[] chars,
@NonNull String valueToFind,
int startIndex)
从指定索引开始查找数组中指定的字符串
|
static int |
indexOf(@NonNull String[] strs,
@NonNull String valueToFind)
查找数组中指定的字符串
|
static int |
indexOf(@NonNull String[] strs,
@NonNull String valueToFind,
int startIndex)
从指定索引开始查找数组中指定的字符串
|
static Object |
moveForward(@NonNull Object array,
int startIndex,
int length)
从指定下标开始,将后面的元素往前复制指定位数
|
static boolean[] |
remove(@NonNull boolean[] array,
int index,
@NonNull Object lastElementValue)
删除指定下标的元素
|
static byte[] |
remove(@NonNull byte[] array,
int index,
@NonNull Object lastElementValue)
删除指定下标的元素
|
static char[] |
remove(@NonNull char[] array,
int index,
@NonNull Object lastElementValue)
删除指定下标的元素
|
static double[] |
remove(@NonNull double[] array,
int index,
@NonNull Object lastElementValue)
删除指定下标的元素
|
static float[] |
remove(@NonNull float[] array,
int index,
@NonNull Object lastElementValue)
删除指定下标的元素
|
static int[] |
remove(@NonNull int[] array,
int index,
@NonNull Object lastElementValue)
删除指定下标的元素
|
static long[] |
remove(@NonNull long[] array,
int index,
@NonNull Object lastElementValue)
删除指定下标的元素
|
static short[] |
remove(@NonNull short[] array,
int index,
@NonNull Object lastElementValue)
删除指定下标的元素
|
static <T> T[] |
remove(T[] array,
int index,
@NonNull Object lastElementValue)
删除指定下标的元素
|
static boolean[] |
removeAllElements(@NonNull boolean[] array,
boolean... vals)
删除所有匹配项
|
static byte[] |
removeAllElements(@NonNull byte[] array,
byte... vals)
删除所有匹配项
|
static char[] |
removeAllElements(@NonNull char[] array,
char... vals)
删除所有匹配项
|
static double[] |
removeAllElements(@NonNull double[] array,
double... vals)
删除所有匹配项
|
static float[] |
removeAllElements(@NonNull float[] array,
float... vals)
删除所有匹配项
|
static int[] |
removeAllElements(@NonNull int[] array,
int... vals)
删除所有匹配项
|
static long[] |
removeAllElements(@NonNull long[] array,
long... vals)
删除所有匹配项
|
static short[] |
removeAllElements(@NonNull short[] array,
short... vals)
删除所有匹配项
|
static <T> T[] |
removeAllElements(T[] array,
T... vals)
删除所有匹配项
|
static byte[] |
toBytes(@NonNull char[] chars)
字符数组转换为 UTF-8 字符集的字节数组
|
static byte[] |
toBytes(@NonNull char[] chars,
@NonNull Charset charsets)
字符数组转换为指定字符集的字节数组
|
static byte[] |
toBytes(@NonNull char[] chars,
@NonNull String charsetName)
字符数组转换为指定字符集的字节数组
|
static char[] |
toChars(@NonNull byte[] bytes)
字节数组转换为 UTF-8 字符集的字符数组
|
static char[] |
toChars(@NonNull byte[] bytes,
@NonNull Charset charsets)
字节数组转换为指定字符集的字符数组
|
static char[] |
toChars(@NonNull byte[] bytes,
@NonNull String charsetName)
字节数组转换为指定字符集的字符数组
|
add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, addAll, addAll, addAll, addAll, addAll, addAll, addAll, addAll, addAll, addFirst, addFirst, addFirst, addFirst, addFirst, addFirst, addFirst, addFirst, addFirst, clone, clone, clone, clone, clone, clone, clone, clone, clone, contains, contains, contains, contains, contains, contains, contains, contains, contains, contains, get, get, getLength, hashCode, indexesOf, indexesOf, indexesOf, indexesOf, indexesOf, indexesOf, indexesOf, indexesOf, indexesOf, indexesOf, indexesOf, indexesOf, indexesOf, indexesOf, indexesOf, indexesOf, indexesOf, indexesOf, indexesOf, indexesOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, indexOf, insert, insert, insert, insert, insert, insert, insert, insert, insert, isArrayIndexValid, isEmpty, isEmpty, isEmpty, isEmpty, isEmpty, isEmpty, isEmpty, isEmpty, isEmpty, isEquals, isNotEmpty, isNotEmpty, isNotEmpty, isNotEmpty, isNotEmpty, isNotEmpty, isNotEmpty, isNotEmpty, isNotEmpty, isSameLength, isSameLength, isSameLength, isSameLength, isSameLength, isSameLength, isSameLength, isSameLength, isSameLength, isSameLength, isSameType, isSorted, isSorted, isSorted, isSorted, isSorted, isSorted, isSorted, isSorted, isSorted, isSorted, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, lastIndexOf, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, nullToEmpty, remove, remove, remove, remove, remove, remove, remove, remove, remove, removeAll, removeAll, removeAll, removeAll, removeAll, removeAll, removeAll, removeAll, removeAll, removeAllOccurences, removeAllOccurences, removeAllOccurences, removeAllOccurences, removeAllOccurences, removeAllOccurences, removeAllOccurences, removeAllOccurences, removeAllOccurences, removeAllOccurrences, removeAllOccurrences, removeAllOccurrences, removeAllOccurrences, removeAllOccurrences, removeAllOccurrences, removeAllOccurrences, removeAllOccurrences, removeAllOccurrences, removeElement, removeElement, removeElement, removeElement, removeElement, removeElement, removeElement, removeElement, removeElement, removeElements, removeElements, removeElements, removeElements, removeElements, removeElements, removeElements, removeElements, removeElements, reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse, reverse, shift, shift, shift, shift, shift, shift, shift, shift, shift, shift, shift, shift, shift, shift, shift, shift, shift, shift, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, shuffle, subarray, subarray, subarray, subarray, subarray, subarray, subarray, subarray, subarray, swap, swap, swap, swap, swap, swap, swap, swap, swap, swap, swap, swap, swap, swap, swap, swap, swap, swap, toArray, toMap, toObject, toObject, toObject, toObject, toObject, toObject, toObject, toObject, toPrimitive, toPrimitive, toPrimitive, toPrimitive, toPrimitive, toPrimitive, toPrimitive, toPrimitive, toPrimitive, toPrimitive, toPrimitive, toPrimitive, toPrimitive, toPrimitive, toPrimitive, toPrimitive, toPrimitive, toString, toString, toStringArray, toStringArraypublic static byte[] toBytes(@NonNull
@NonNull char[] chars,
@NonNull
@NonNull Charset charsets)
chars - 字符数组charsets - 字符集public static byte[] toBytes(@NonNull
@NonNull char[] chars,
@NonNull
@NonNull String charsetName)
throws UnsupportedEncodingException
chars - 字符数组charsetName - 字符集UnsupportedEncodingException - 字符编码不支持public static byte[] toBytes(@NonNull
@NonNull char[] chars)
chars - 字符数组public static char[] toChars(@NonNull
@NonNull byte[] bytes,
@NonNull
@NonNull Charset charsets)
bytes - 字节数组charsets - 字符集public static char[] toChars(@NonNull
@NonNull byte[] bytes,
@NonNull
@NonNull String charsetName)
throws UnsupportedEncodingException
bytes - 字节数组charsetName - 字符集UnsupportedEncodingException - 字符编码不支持public static char[] toChars(@NonNull
@NonNull byte[] bytes)
bytes - 字节数组public static Object moveForward(@NonNull @NonNull Object array, int startIndex, int length)
array - 数组startIndex - 开始下标length - 位数public static <T> T[] remove(@NonNull
T[] array,
int index,
@NonNull
@NonNull Object lastElementValue)
T - 数组类型array - 数组index - 下标lastElementValue - 最后一个元素的值public static boolean[] remove(@NonNull
@NonNull boolean[] array,
int index,
@NonNull
@NonNull Object lastElementValue)
array - 数组index - 下标lastElementValue - 最后一个元素的值public static byte[] remove(@NonNull
@NonNull byte[] array,
int index,
@NonNull
@NonNull Object lastElementValue)
array - 数组index - 下标lastElementValue - 最后一个元素的值public static char[] remove(@NonNull
@NonNull char[] array,
int index,
@NonNull
@NonNull Object lastElementValue)
array - 数组index - 下标lastElementValue - 最后一个元素的值public static double[] remove(@NonNull
@NonNull double[] array,
int index,
@NonNull
@NonNull Object lastElementValue)
array - 数组index - 下标lastElementValue - 最后一个元素的值public static float[] remove(@NonNull
@NonNull float[] array,
int index,
@NonNull
@NonNull Object lastElementValue)
array - 数组index - 下标lastElementValue - 最后一个元素的值public static short[] remove(@NonNull
@NonNull short[] array,
int index,
@NonNull
@NonNull Object lastElementValue)
array - 数组index - 下标lastElementValue - 最后一个元素的值public static int[] remove(@NonNull
@NonNull int[] array,
int index,
@NonNull
@NonNull Object lastElementValue)
array - 数组index - 下标lastElementValue - 最后一个元素的值public static long[] remove(@NonNull
@NonNull long[] array,
int index,
@NonNull
@NonNull Object lastElementValue)
array - 数组index - 下标lastElementValue - 最后一个元素的值public static <T> T[] fill(@NonNull
T[] array,
int fromIndex,
int toIndex,
Object val)
T - 数组类型array - 数组fromIndex - 开始下标toIndex - 结束下标val - 填充值public static boolean[] fill(@NonNull
@NonNull boolean[] array,
int fromIndex,
int toIndex,
Object val)
array - 数组fromIndex - 开始下标toIndex - 结束下标val - 填充值public static byte[] fill(@NonNull
@NonNull byte[] array,
int fromIndex,
int toIndex,
Object val)
array - 数组fromIndex - 开始下标toIndex - 结束下标val - 填充值public static char[] fill(@NonNull
@NonNull char[] array,
int fromIndex,
int toIndex,
Object val)
array - 数组fromIndex - 开始下标toIndex - 结束下标val - 填充值public static double[] fill(@NonNull
@NonNull double[] array,
int fromIndex,
int toIndex,
Object val)
array - 数组fromIndex - 开始下标toIndex - 结束下标val - 填充值public static float[] fill(@NonNull
@NonNull float[] array,
int fromIndex,
int toIndex,
Object val)
array - 数组fromIndex - 开始下标toIndex - 结束下标val - 填充值public static short[] fill(@NonNull
@NonNull short[] array,
int fromIndex,
int toIndex,
Object val)
array - 数组fromIndex - 开始下标toIndex - 结束下标val - 填充值public static int[] fill(@NonNull
@NonNull int[] array,
int fromIndex,
int toIndex,
Object val)
array - 数组fromIndex - 开始下标toIndex - 结束下标val - 填充值public static long[] fill(@NonNull
@NonNull long[] array,
int fromIndex,
int toIndex,
Object val)
array - 数组fromIndex - 开始下标toIndex - 结束下标val - 填充值public static <T> T[] removeAllElements(@NonNull
T[] array,
@NonNull
T... vals)
T - 数组类型array - 数组vals - 需要删除的内容public static boolean[] removeAllElements(@NonNull
@NonNull boolean[] array,
@NonNull
boolean... vals)
array - 数组vals - 需要删除的内容public static byte[] removeAllElements(@NonNull
@NonNull byte[] array,
@NonNull
byte... vals)
array - 数组vals - 需要删除的内容public static char[] removeAllElements(@NonNull
@NonNull char[] array,
@NonNull
char... vals)
array - 数组vals - 需要删除的内容public static double[] removeAllElements(@NonNull
@NonNull double[] array,
@NonNull
double... vals)
array - 数组vals - 需要删除的内容public static float[] removeAllElements(@NonNull
@NonNull float[] array,
@NonNull
float... vals)
array - 数组vals - 需要删除的内容public static short[] removeAllElements(@NonNull
@NonNull short[] array,
@NonNull
short... vals)
array - 数组vals - 需要删除的内容public static int[] removeAllElements(@NonNull
@NonNull int[] array,
@NonNull
int... vals)
array - 数组vals - 需要删除的内容public static long[] removeAllElements(@NonNull
@NonNull long[] array,
@NonNull
long... vals)
array - 数组vals - 需要删除的内容public static int indexOf(@NonNull
@NonNull char[] chars,
@NonNull
@NonNull String valueToFind,
int startIndex)
chars - 字符数组valueToFind - 要查找的字符串startIndex - 开始查找的索引public static int indexOf(@NonNull
@NonNull char[] chars,
@NonNull
@NonNull String valueToFind)
chars - 字符数组valueToFind - 要查找的字符串public static int indexOf(@NonNull
@NonNull String[] strs,
@NonNull
@NonNull String valueToFind,
int startIndex)
strs - 字符串数组valueToFind - 要查找的字符串startIndex - 开始查找的索引public static int indexOf(@NonNull
@NonNull String[] strs,
@NonNull
@NonNull String valueToFind)
strs - 字符串数组valueToFind - 要查找的字符串public static int allLength(@NonNull
String... strs)
strs - 字符串数组Copyright © 2022. All rights reserved.