public class ArrayUtil extends Object
null,而不会抛出NullPointerException。| 限定符和类型 | 字段和说明 |
|---|---|
static boolean[] |
EMPTY_BOOLEAN_ARRAY
空的
boolean数组。 |
static Boolean[] |
EMPTY_BOOLEAN_OBJECT_ARRAY
空的
Boolean数组。 |
static byte[] |
EMPTY_BYTE_ARRAY
空的
byte数组。 |
static Byte[] |
EMPTY_BYTE_OBJECT_ARRAY
空的
Byte数组。 |
static char[] |
EMPTY_CHAR_ARRAY
空的
char数组。 |
static Character[] |
EMPTY_CHARACTER_OBJECT_ARRAY
空的
Character数组。 |
static Class[] |
EMPTY_CLASS_ARRAY
空的
Class数组。 |
static double[] |
EMPTY_DOUBLE_ARRAY
空的
double数组。 |
static Double[] |
EMPTY_DOUBLE_OBJECT_ARRAY
空的
Double数组。 |
static float[] |
EMPTY_FLOAT_ARRAY
空的
float数组。 |
static Float[] |
EMPTY_FLOAT_OBJECT_ARRAY
空的
Float数组。 |
static int[] |
EMPTY_INT_ARRAY
空的
int数组。 |
static Integer[] |
EMPTY_INTEGER_OBJECT_ARRAY
空的
Integer数组。 |
static long[] |
EMPTY_LONG_ARRAY
空的
long数组。 |
static Long[] |
EMPTY_LONG_OBJECT_ARRAY
空的
Long数组。 |
static Object[] |
EMPTY_OBJECT_ARRAY
空的
Object数组。 |
static short[] |
EMPTY_SHORT_ARRAY
空的
short数组。 |
static Short[] |
EMPTY_SHORT_OBJECT_ARRAY
空的
Short数组。 |
static String[] |
EMPTY_STRING_ARRAY
空的
String数组。 |
| 构造器和说明 |
|---|
ArrayUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static boolean[] |
clone(boolean[] array)
复制一个数组。
|
static byte[] |
clone(byte[] array)
复制一个数组。
|
static char[] |
clone(char[] array)
复制一个数组。
|
static double[] |
clone(double[] array)
复制一个数组。
|
static float[] |
clone(float[] array)
复制一个数组。
|
static int[] |
clone(int[] array)
复制一个数组。
|
static long[] |
clone(long[] array)
复制一个数组。
|
static Object[] |
clone(Object[] array)
复制一个数组。
|
static short[] |
clone(short[] array)
复制一个数组。
|
static boolean |
contains(boolean[] array,
boolean booleanToFind)
判断指定对象是否存在于指定数组中。
|
static boolean |
contains(boolean[] array,
boolean[] arrayToFind)
判断指定元素序列是否存在于指定数组中。
|
static boolean |
contains(byte[] array,
byte byteToFind)
判断指定对象是否存在于指定数组中。
|
static boolean |
contains(byte[] array,
byte[] arrayToFind)
判断指定元素序列是否存在于指定数组中。
|
static boolean |
contains(char[] array,
char charToFind)
判断指定对象是否存在于指定数组中。
|
static boolean |
contains(char[] array,
char[] arrayToFind)
判断指定元素序列是否存在于指定数组中。
|
static boolean |
contains(double[] array,
double doubleToFind)
判断指定对象是否存在于指定数组中。
|
static boolean |
contains(double[] array,
double[] arrayToFind)
判断指定元素序列是否存在于指定数组中。
|
static boolean |
contains(double[] array,
double[] arrayToFind,
double tolerance)
判断指定元素序列是否存在于指定数组中。
|
static boolean |
contains(double[] array,
double doubleToFind,
double tolerance)
判断指定对象是否存在于指定数组中。
|
static boolean |
contains(float[] array,
float floatToFind)
判断指定对象是否存在于指定数组中。
|
static boolean |
contains(float[] array,
float[] arrayToFind)
判断指定元素序列是否存在于指定数组中。
|
static boolean |
contains(float[] array,
float[] arrayToFind,
float tolerance)
判断指定元素序列是否存在于指定数组中。
|
static boolean |
contains(float[] array,
float floatToFind,
float tolerance)
判断指定对象是否存在于指定数组中。
|
static boolean |
contains(int[] array,
int intToFind)
判断指定对象是否存在于指定数组中。
|
static boolean |
contains(int[] array,
int[] arrayToFind)
判断指定元素序列是否存在于指定数组中。
|
static boolean |
contains(long[] array,
long longToFind)
判断指定对象是否存在于指定数组中。
|
static boolean |
contains(long[] array,
long[] arrayToFind)
判断指定元素序列是否存在于指定数组中。
|
static boolean |
contains(Object[] array,
Object objectToFind)
判断指定对象是否存在于指定数组中。
|
static boolean |
contains(Object[] array,
Object[] arrayToFind)
判断指定元素序列是否存在于指定数组中。
|
static boolean |
contains(short[] array,
short shortToFind)
判断指定对象是否存在于指定数组中。
|
static boolean |
contains(short[] array,
short[] arrayToFind)
判断指定元素序列是否存在于指定数组中。
|
static boolean[] |
defaultIfEmpty(boolean[] array)
如果数组是
null或空数组[],则返回空数组[],否则返回数组本身。 |
static boolean[] |
defaultIfEmpty(boolean[] array,
boolean[] defaultArray)
如果数组是
null或空数组[],则返回指定默认数组,否则返回数组本身。 |
static byte[] |
defaultIfEmpty(byte[] array)
如果数组是
null或空数组[],则返回空数组[],否则返回数组本身。 |
static byte[] |
defaultIfEmpty(byte[] array,
byte[] defaultArray)
如果数组是
null或空数组[],则返回指定默认数组,否则返回数组本身。 |
static char[] |
defaultIfEmpty(char[] array)
如果数组是
null或空数组[],则返回空数组[],否则返回数组本身。 |
static char[] |
defaultIfEmpty(char[] array,
char[] defaultArray)
如果数组是
null或空数组[],则返回指定默认数组,否则返回数组本身。 |
static double[] |
defaultIfEmpty(double[] array)
如果数组是
null或空数组[],则返回空数组[],否则返回数组本身。 |
static double[] |
defaultIfEmpty(double[] array,
double[] defaultArray)
如果数组是
null或空数组[],则返回指定默认数组,否则返回数组本身。 |
static float[] |
defaultIfEmpty(float[] array)
如果数组是
null或空数组[],则返回空数组[],否则返回数组本身。 |
static float[] |
defaultIfEmpty(float[] array,
float[] defaultArray)
如果数组是
null或空数组[],则返回指定默认数组,否则返回数组本身。 |
static int[] |
defaultIfEmpty(int[] array)
如果数组是
null或空数组[],则返回空数组[],否则返回数组本身。 |
static int[] |
defaultIfEmpty(int[] array,
int[] defaultArray)
如果数组是
null或空数组[],则返回指定默认数组,否则返回数组本身。 |
static long[] |
defaultIfEmpty(long[] array)
如果数组是
null或空数组[],则返回空数组[],否则返回数组本身。 |
static long[] |
defaultIfEmpty(long[] array,
long[] defaultArray)
如果数组是
null或空数组[],则返回指定默认数组,否则返回数组本身。 |
static Object[] |
defaultIfEmpty(Object[] array)
如果数组是
null或空数组[],则返回空数组[],否则返回数组本身。 |
static Object[] |
defaultIfEmpty(Object[] array,
Class defaultComponentType)
如果数组是
null或空数组[],则返回指定元素类型的空数组,否则返回数组本身。 |
static Object[] |
defaultIfEmpty(Object[] array,
Object[] defaultArray)
如果数组是
null或空数组[],则返回指定默认数组,否则返回数组本身。 |
static short[] |
defaultIfEmpty(short[] array)
如果数组是
null或空数组[],则返回空数组[],否则返回数组本身。 |
static short[] |
defaultIfEmpty(short[] array,
short[] defaultArray)
如果数组是
null或空数组[],则返回指定默认数组,否则返回数组本身。 |
static boolean[] |
defaultIfNull(boolean[] array)
如果数组是
null,则返回空数组[],否则返回数组本身。 |
static boolean[] |
defaultIfNull(boolean[] array,
boolean[] defaultArray)
如果数组是
null,则返回指定默认数组,否则返回数组本身。 |
static byte[] |
defaultIfNull(byte[] array)
如果数组是
null,则返回空数组[],否则返回数组本身。 |
static byte[] |
defaultIfNull(byte[] array,
byte[] defaultArray)
如果数组是
null,则返回指定默认数组,否则返回数组本身。 |
static char[] |
defaultIfNull(char[] array)
如果数组是
null,则返回空数组[],否则返回数组本身。 |
static char[] |
defaultIfNull(char[] array,
char[] defaultArray)
如果数组是
null,则返回指定默认数组,否则返回数组本身。 |
static double[] |
defaultIfNull(double[] array)
如果数组是
null,则返回空数组[],否则返回数组本身。 |
static double[] |
defaultIfNull(double[] array,
double[] defaultArray)
如果数组是
null,则返回指定默认数组,否则返回数组本身。 |
static float[] |
defaultIfNull(float[] array)
如果数组是
null,则返回空数组[],否则返回数组本身。 |
static float[] |
defaultIfNull(float[] array,
float[] defaultArray)
如果数组是
null,则返回指定默认数组,否则返回数组本身。 |
static int[] |
defaultIfNull(int[] array)
如果数组是
null,则返回空数组[],否则返回数组本身。 |
static int[] |
defaultIfNull(int[] array,
int[] defaultArray)
如果数组是
null,则返回指定默认数组,否则返回数组本身。 |
static long[] |
defaultIfNull(long[] array)
如果数组是
null,则返回空数组[],否则返回数组本身。 |
static long[] |
defaultIfNull(long[] array,
long[] defaultArray)
如果数组是
null,则返回指定默认数组,否则返回数组本身。 |
static Object[] |
defaultIfNull(Object[] array)
如果数组是
null,则返回空数组[],否则返回数组本身。 |
static Object[] |
defaultIfNull(Object[] array,
Class defaultComponentType)
如果数组是
null,则返回指定元素类型的空数组,否则返回数组本身。 |
static Object[] |
defaultIfNull(Object[] array,
Object[] defaultArray)
如果数组是
null,则返回指定默认数组,否则返回数组本身。 |
static short[] |
defaultIfNull(short[] array)
如果数组是
null,则返回空数组[],否则返回数组本身。 |
static short[] |
defaultIfNull(short[] array,
short[] defaultArray)
如果数组是
null,则返回指定默认数组,否则返回数组本身。 |
static boolean |
equals(Object array1,
Object array2)
递归地比较两个数组是否相同,支持多维数组。
|
static int |
hashCode(Object array)
取得数组的hash值, 如果数组为
null, 则返回0。 |
static int |
indexOf(boolean[] array,
boolean booleanToFind)
在数组中查找一个元素。
|
static int |
indexOf(boolean[] array,
boolean[] arrayToFind)
在数组中查找一个元素序列。
|
static int |
indexOf(boolean[] array,
boolean[] arrayToFind,
int startIndex)
在数组中查找一个元素序列。
|
static int |
indexOf(boolean[] array,
boolean booleanToFind,
int startIndex)
在数组中查找一个元素。
|
static int |
indexOf(byte[] array,
byte byteToFind)
在数组中查找一个元素。
|
static int |
indexOf(byte[] array,
byte[] arrayToFind)
在数组中查找一个元素序列。
|
static int |
indexOf(byte[] array,
byte[] arrayToFind,
int startIndex)
在数组中查找一个元素序列。
|
static int |
indexOf(byte[] array,
byte byteToFind,
int startIndex)
在数组中查找一个元素。
|
static int |
indexOf(char[] array,
char charToFind)
在数组中查找一个元素。
|
static int |
indexOf(char[] array,
char[] arrayToFind)
在数组中查找一个元素序列。
|
static int |
indexOf(char[] array,
char[] arrayToFind,
int startIndex)
在数组中查找一个元素序列。
|
static int |
indexOf(char[] array,
char charToFind,
int startIndex)
在数组中查找一个元素。
|
static int |
indexOf(double[] array,
double doubleToFind)
在数组中查找一个元素。
|
static int |
indexOf(double[] array,
double[] arrayToFind)
在数组中查找一个元素序列。
|
static int |
indexOf(double[] array,
double[] arrayToFind,
double tolerance)
在数组中查找一个元素序列。
|
static int |
indexOf(double[] array,
double[] arrayToFind,
int startIndex)
在数组中查找一个元素序列。
|
static int |
indexOf(double[] array,
double[] arrayToFind,
int startIndex,
double tolerance)
在数组中查找一个元素序列。
|
static int |
indexOf(double[] array,
double doubleToFind,
double tolerance)
在数组中查找一个元素。
|
static int |
indexOf(double[] array,
double doubleToFind,
int startIndex)
在数组中查找一个元素。
|
static int |
indexOf(double[] array,
double doubleToFind,
int startIndex,
double tolerance)
在数组中查找一个元素。
|
static int |
indexOf(float[] array,
float floatToFind)
在数组中查找一个元素。
|
static int |
indexOf(float[] array,
float[] arrayToFind)
在数组中查找一个元素序列。
|
static int |
indexOf(float[] array,
float[] arrayToFind,
float tolerance)
在数组中查找一个元素序列。
|
static int |
indexOf(float[] array,
float[] arrayToFind,
int startIndex)
在数组中查找一个元素序列。
|
static int |
indexOf(float[] array,
float[] arrayToFind,
int startIndex,
float tolerance)
在数组中查找一个元素序列。
|
static int |
indexOf(float[] array,
float floatToFind,
float tolerance)
在数组中查找一个元素。
|
static int |
indexOf(float[] array,
float floatToFind,
int startIndex)
在数组中查找一个元素。
|
static int |
indexOf(float[] array,
float floatToFind,
int startIndex,
float tolerance)
在数组中查找一个元素。
|
static int |
indexOf(int[] array,
int intToFind)
在数组中查找一个元素。
|
static int |
indexOf(int[] array,
int[] arrayToFind)
在数组中查找一个元素序列。
|
static int |
indexOf(int[] array,
int[] arrayToFind,
int startIndex)
在数组中查找一个元素序列。
|
static int |
indexOf(int[] array,
int intToFind,
int startIndex)
在数组中查找一个元素。
|
static int |
indexOf(long[] array,
long longToFind)
在数组中查找一个元素。
|
static int |
indexOf(long[] array,
long[] arrayToFind)
在数组中查找一个元素序列。
|
static int |
indexOf(long[] array,
long[] arrayToFind,
int startIndex)
在数组中查找一个元素序列。
|
static int |
indexOf(long[] array,
long longToFind,
int startIndex)
在数组中查找一个元素。
|
static int |
indexOf(Object[] array,
Object objectToFind)
在数组中查找一个元素。
|
static int |
indexOf(Object[] array,
Object[] arrayToFind)
在数组中查找一个元素序列。
|
static int |
indexOf(Object[] array,
Object[] arrayToFind,
int startIndex)
在数组中查找一个元素序列。
|
static int |
indexOf(Object[] array,
Object objectToFind,
int startIndex)
在数组中查找一个元素。
|
static int |
indexOf(short[] array,
short shortToFind)
在数组中查找一个元素。
|
static int |
indexOf(short[] array,
short[] arrayToFind)
在数组中查找一个元素序列。
|
static int |
indexOf(short[] array,
short[] arrayToFind,
int startIndex)
在数组中查找一个元素序列。
|
static int |
indexOf(short[] array,
short shortToFind,
int startIndex)
在数组中查找一个元素。
|
static boolean |
isEmpty(boolean[] array)
检查数组是否为
null或空数组[]。 |
static boolean |
isEmpty(byte[] array)
检查数组是否为
null或空数组[]。 |
static boolean |
isEmpty(char[] array)
检查数组是否为
null或空数组[]。 |
static boolean |
isEmpty(double[] array)
检查数组是否为
null或空数组[]。 |
static boolean |
isEmpty(float[] array)
检查数组是否为
null或空数组[]。 |
static boolean |
isEmpty(int[] array)
检查数组是否为
null或空数组[]。 |
static boolean |
isEmpty(long[] array)
检查数组是否为
null或空数组[]。 |
static boolean |
isEmpty(Object[] array)
检查数组是否为
null或空数组[]。 |
static boolean |
isEmpty(short[] array)
检查数组是否为
null或空数组[]。 |
static boolean |
isNotEmpty(boolean[] array)
检查数组是否不是
null和空数组[]。 |
static boolean |
isNotEmpty(byte[] array)
检查数组是否不是
null和空数组[]。 |
static boolean |
isNotEmpty(char[] array)
检查数组是否不是
null和空数组[]。 |
static boolean |
isNotEmpty(double[] array)
检查数组是否不是
null和空数组[]。 |
static boolean |
isNotEmpty(float[] array)
检查数组是否不是
null和空数组[]。 |
static boolean |
isNotEmpty(int[] array)
检查数组是否不是
null和空数组[]。 |
static boolean |
isNotEmpty(long[] array)
检查数组是否不是
null和空数组[]。 |
static boolean |
isNotEmpty(Object[] array)
检查数组是否不是
null和空数组[]。 |
static boolean |
isNotEmpty(short[] array)
检查数组是否不是
null和空数组[]。 |
static boolean |
isSameLength(boolean[] array1,
boolean[] array2)
判断两个数组是否具有相同的长度。
|
static boolean |
isSameLength(byte[] array1,
byte[] array2)
判断两个数组是否具有相同的长度。
|
static boolean |
isSameLength(char[] array1,
char[] array2)
判断两个数组是否具有相同的长度。
|
static boolean |
isSameLength(double[] array1,
double[] array2)
判断两个数组是否具有相同的长度。
|
static boolean |
isSameLength(float[] array1,
float[] array2)
判断两个数组是否具有相同的长度。
|
static boolean |
isSameLength(int[] array1,
int[] array2)
判断两个数组是否具有相同的长度。
|
static boolean |
isSameLength(long[] array1,
long[] array2)
判断两个数组是否具有相同的长度。
|
static boolean |
isSameLength(Object[] array1,
Object[] array2)
判断两个数组是否具有相同的长度。
|
static boolean |
isSameLength(short[] array1,
short[] array2)
判断两个数组是否具有相同的长度。
|
static int |
lastIndexOf(boolean[] array,
boolean booleanToFind)
在数组中从末尾开始查找一个元素。
|
static int |
lastIndexOf(boolean[] array,
boolean[] arrayToFind)
在数组中从末尾开始查找一个元素序列。
|
static int |
lastIndexOf(boolean[] array,
boolean[] arrayToFind,
int startIndex)
在数组中从末尾开始查找一个元素序列。
|
static int |
lastIndexOf(boolean[] array,
boolean booleanToFind,
int startIndex)
在数组中从末尾开始查找一个元素。
|
static int |
lastIndexOf(byte[] array,
byte byteToFind)
在数组中从末尾开始查找一个元素。
|
static int |
lastIndexOf(byte[] array,
byte[] arrayToFind)
在数组中从末尾开始查找一个元素序列。
|
static int |
lastIndexOf(byte[] array,
byte[] arrayToFind,
int startIndex)
在数组中从末尾开始查找一个元素序列。
|
static int |
lastIndexOf(byte[] array,
byte byteToFind,
int startIndex)
在数组中从末尾开始查找一个元素。
|
static int |
lastIndexOf(char[] array,
char charToFind)
在数组中从末尾开始查找一个元素。
|
static int |
lastIndexOf(char[] array,
char[] arrayToFind)
在数组中从末尾开始查找一个元素序列。
|
static int |
lastIndexOf(char[] array,
char[] arrayToFind,
int startIndex)
在数组中从末尾开始查找一个元素序列。
|
static int |
lastIndexOf(char[] array,
char charToFind,
int startIndex)
在数组中从末尾开始查找一个元素。
|
static int |
lastIndexOf(double[] array,
double doubleToFind)
在数组中从末尾开始查找一个元素。
|
static int |
lastIndexOf(double[] array,
double[] arrayToFind)
在数组中从末尾开始查找一个元素序列。
|
static int |
lastIndexOf(double[] array,
double[] arrayToFind,
double tolerance)
在数组中从末尾开始查找一个元素序列。
|
static int |
lastIndexOf(double[] array,
double[] arrayToFind,
int startIndex)
在数组中从末尾开始查找一个元素序列。
|
static int |
lastIndexOf(double[] array,
double[] arrayToFind,
int startIndex,
double tolerance)
在数组中从末尾开始查找一个元素序列。
|
static int |
lastIndexOf(double[] array,
double doubleToFind,
double tolerance)
在数组中从末尾开始查找一个元素。
|
static int |
lastIndexOf(double[] array,
double doubleToFind,
int startIndex)
在数组中从末尾开始查找一个元素。
|
static int |
lastIndexOf(double[] array,
double doubleToFind,
int startIndex,
double tolerance)
在数组中从末尾开始查找一个元素。
|
static int |
lastIndexOf(float[] array,
float floatToFind)
在数组中从末尾开始查找一个元素。
|
static int |
lastIndexOf(float[] array,
float[] arrayToFind)
在数组中从末尾开始查找一个元素序列。
|
static int |
lastIndexOf(float[] array,
float[] arrayToFind,
float tolerance)
在数组中从末尾开始查找一个元素序列。
|
static int |
lastIndexOf(float[] array,
float[] arrayToFind,
int startIndex)
在数组中从末尾开始查找一个元素序列。
|
static int |
lastIndexOf(float[] array,
float[] arrayToFind,
int startIndex,
float tolerance)
在数组中从末尾开始查找一个元素序列。
|
static int |
lastIndexOf(float[] array,
float floatToFind,
float tolerance)
在数组中从末尾开始查找一个元素。
|
static int |
lastIndexOf(float[] array,
float floatToFind,
int startIndex)
在数组中从末尾开始查找一个元素。
|
static int |
lastIndexOf(float[] array,
float floatToFind,
int startIndex,
float tolerance)
在数组中从末尾开始查找一个元素。
|
static int |
lastIndexOf(int[] array,
int intToFind)
在数组中从末尾开始查找一个元素。
|
static int |
lastIndexOf(int[] array,
int[] arrayToFind)
在数组中从末尾开始查找一个元素序列。
|
static int |
lastIndexOf(int[] array,
int[] arrayToFind,
int startIndex)
在数组中从末尾开始查找一个元素序列。
|
static int |
lastIndexOf(int[] array,
int intToFind,
int startIndex)
在数组中从末尾开始查找一个元素。
|
static int |
lastIndexOf(long[] array,
long longToFind)
在数组中从末尾开始查找一个元素。
|
static int |
lastIndexOf(long[] array,
long[] arrayToFind)
在数组中从末尾开始查找一个元素序列。
|
static int |
lastIndexOf(long[] array,
long[] arrayToFind,
int startIndex)
在数组中从末尾开始查找一个元素序列。
|
static int |
lastIndexOf(long[] array,
long longToFind,
int startIndex)
在数组中从末尾开始查找一个元素。
|
static int |
lastIndexOf(Object[] array,
Object objectToFind)
在数组中从末尾开始查找一个元素。
|
static int |
lastIndexOf(Object[] array,
Object[] arrayToFind)
在数组中从末尾开始查找一个元素序列。
|
static int |
lastIndexOf(Object[] array,
Object[] arrayToFind,
int startIndex)
在数组中从末尾开始查找一个元素序列。
|
static int |
lastIndexOf(Object[] array,
Object objectToFind,
int startIndex)
在数组中从末尾开始查找一个元素。
|
static int |
lastIndexOf(short[] array,
short shortToFind)
在数组中从末尾开始查找一个元素。
|
static int |
lastIndexOf(short[] array,
short[] arrayToFind)
在数组中从末尾开始查找一个元素序列。
|
static int |
lastIndexOf(short[] array,
short[] arrayToFind,
int startIndex)
在数组中从末尾开始查找一个元素序列。
|
static int |
lastIndexOf(short[] array,
short shortToFind,
int startIndex)
在数组中从末尾开始查找一个元素。
|
static void |
reverse(boolean[] array)
反转数组的元素顺序。
|
static void |
reverse(byte[] array)
反转数组的元素顺序。
|
static void |
reverse(char[] array)
反转数组的元素顺序。
|
static void |
reverse(double[] array)
反转数组的元素顺序。
|
static void |
reverse(float[] array)
反转数组的元素顺序。
|
static void |
reverse(int[] array)
反转数组的元素顺序。
|
static void |
reverse(long[] array)
反转数组的元素顺序。
|
static void |
reverse(Object[] array)
反转数组的元素顺序。
|
static void |
reverse(short[] array)
反转数组的元素顺序。
|
static List |
toFixedList(Object[] array)
将数组映射成固定长度的
List,当改变这个List中的值时。 |
static List |
toList(Object array)
将数组转换成
List。 |
static List |
toList(Object array,
List list)
将数组转换成
List。 |
static Map |
toMap(Object[] array)
将数组转换成
Map。 |
static Map |
toMap(Object[] array,
Map map)
将数组转换成
Map。 |
static String |
toString(Object array)
将数组转换成易于阅读的字符串表示。
|
static String |
toString(Object array,
String nullArrayStr)
将数组转换成易于阅读的字符串表示。
|
static String |
toString(Object array,
String nullArrayStr,
String nullElementStr)
将数组转换成易于阅读的字符串表示。
|
public static final Object[] EMPTY_OBJECT_ARRAY
Object数组。public static final Class[] EMPTY_CLASS_ARRAY
Class数组。public static final String[] EMPTY_STRING_ARRAY
String数组。public static final long[] EMPTY_LONG_ARRAY
long数组。public static final Long[] EMPTY_LONG_OBJECT_ARRAY
Long数组。public static final int[] EMPTY_INT_ARRAY
int数组。public static final Integer[] EMPTY_INTEGER_OBJECT_ARRAY
Integer数组。public static final short[] EMPTY_SHORT_ARRAY
short数组。public static final Short[] EMPTY_SHORT_OBJECT_ARRAY
Short数组。public static final byte[] EMPTY_BYTE_ARRAY
byte数组。public static final Byte[] EMPTY_BYTE_OBJECT_ARRAY
Byte数组。public static final double[] EMPTY_DOUBLE_ARRAY
double数组。public static final Double[] EMPTY_DOUBLE_OBJECT_ARRAY
Double数组。public static final float[] EMPTY_FLOAT_ARRAY
float数组。public static final Float[] EMPTY_FLOAT_OBJECT_ARRAY
Float数组。public static final boolean[] EMPTY_BOOLEAN_ARRAY
boolean数组。public static final Boolean[] EMPTY_BOOLEAN_OBJECT_ARRAY
Boolean数组。public static final char[] EMPTY_CHAR_ARRAY
char数组。public static final Character[] EMPTY_CHARACTER_OBJECT_ARRAY
Character数组。public static boolean isEmpty(Object[] array)
null或空数组[]。
ArrayUtil.isEmpty(null) = true ArrayUtil.isEmpty(new String[0]) = true ArrayUtil.isEmpty(new String[10]) = falsearray 要检查的数组 如果为空, 则返回
truepublic static boolean isEmpty(long[] array)
null或空数组[]。
ArrayUtil.isEmpty(null) = true ArrayUtil.isEmpty(new long[0]) = true ArrayUtil.isEmpty(new long[10]) = falsearray 要检查的数组 如果为空, 则返回
truepublic static boolean isEmpty(int[] array)
null或空数组[]。
ArrayUtil.isEmpty(null) = true ArrayUtil.isEmpty(new int[0]) = true ArrayUtil.isEmpty(new int[10]) = falsearray 要检查的数组 如果为空, 则返回
truepublic static boolean isEmpty(short[] array)
null或空数组[]。
ArrayUtil.isEmpty(null) = true ArrayUtil.isEmpty(new short[0]) = true ArrayUtil.isEmpty(new short[10]) = falsearray 要检查的数组 如果为空, 则返回
truepublic static boolean isEmpty(byte[] array)
null或空数组[]。
ArrayUtil.isEmpty(null) = true ArrayUtil.isEmpty(new byte[0]) = true ArrayUtil.isEmpty(new byte[10]) = falsearray 要检查的数组 如果为空, 则返回
truepublic static boolean isEmpty(double[] array)
null或空数组[]。
ArrayUtil.isEmpty(null) = true ArrayUtil.isEmpty(new double[0]) = true ArrayUtil.isEmpty(new double[10]) = falsearray 要检查的数组 如果为空, 则返回
truepublic static boolean isEmpty(float[] array)
null或空数组[]。
ArrayUtil.isEmpty(null) = true ArrayUtil.isEmpty(new float[0]) = true ArrayUtil.isEmpty(new float[10]) = falsearray 要检查的数组 如果为空, 则返回
truepublic static boolean isEmpty(boolean[] array)
null或空数组[]。
ArrayUtil.isEmpty(null) = true ArrayUtil.isEmpty(new boolean[0]) = true ArrayUtil.isEmpty(new boolean[10]) = falsearray 要检查的数组 如果为空, 则返回
truepublic static boolean isEmpty(char[] array)
null或空数组[]。
ArrayUtil.isEmpty(null) = true ArrayUtil.isEmpty(new char[0]) = true ArrayUtil.isEmpty(new char[10]) = falsearray 要检查的数组 如果为空, 则返回
truepublic static boolean isNotEmpty(Object[] array)
null和空数组[]。
ArrayUtil.isEmpty(null) = false ArrayUtil.isEmpty(new String[0]) = false ArrayUtil.isEmpty(new String[10]) = truearray 要检查的数组 如果不为空, 则返回
truepublic static boolean isNotEmpty(long[] array)
null和空数组[]。
ArrayUtil.isEmpty(null) = false ArrayUtil.isEmpty(new long[0]) = false ArrayUtil.isEmpty(new long[10]) = truearray 要检查的数组 如果不为空, 则返回
truepublic static boolean isNotEmpty(int[] array)
null和空数组[]。
ArrayUtil.isEmpty(null) = false ArrayUtil.isEmpty(new int[0]) = false ArrayUtil.isEmpty(new int[10]) = truearray 要检查的数组 如果不为空, 则返回
truepublic static boolean isNotEmpty(short[] array)
null和空数组[]。
ArrayUtil.isEmpty(null) = false ArrayUtil.isEmpty(new short[0]) = false ArrayUtil.isEmpty(new short[10]) = truearray 要检查的数组 如果不为空, 则返回
truepublic static boolean isNotEmpty(byte[] array)
null和空数组[]。
ArrayUtil.isEmpty(null) = false ArrayUtil.isEmpty(new byte[0]) = false ArrayUtil.isEmpty(new byte[10]) = truearray 要检查的数组 如果不为空, 则返回
truepublic static boolean isNotEmpty(double[] array)
null和空数组[]。
ArrayUtil.isEmpty(null) = false ArrayUtil.isEmpty(new double[0]) = false ArrayUtil.isEmpty(new double[10]) = truearray 要检查的数组 如果不为空, 则返回
truepublic static boolean isNotEmpty(float[] array)
null和空数组[]。
ArrayUtil.isEmpty(null) = false ArrayUtil.isEmpty(new float[0]) = false ArrayUtil.isEmpty(new float[10]) = truearray 要检查的数组 如果不为空, 则返回
truepublic static boolean isNotEmpty(boolean[] array)
null和空数组[]。
ArrayUtil.isEmpty(null) = false ArrayUtil.isEmpty(new boolean[0]) = false ArrayUtil.isEmpty(new boolean[10]) = truearray 要检查的数组 如果不为空, 则返回
truepublic static boolean isNotEmpty(char[] array)
null和空数组[]。
ArrayUtil.isEmpty(null) = false ArrayUtil.isEmpty(new char[0]) = false ArrayUtil.isEmpty(new char[10]) = truearray 要检查的数组 如果不为空, 则返回
truepublic static Object[] defaultIfNull(Object[] array)
null,则返回空数组[],否则返回数组本身。
ArrayUtil.defaultIfNull(null) = [] ArrayUtil.defaultIfNull(new String[0]) = 数组本身 ArrayUtil.defaultIfNull(new String[10]) = 数组本身array 要转换的数组 数组本身或空数组
[]public static long[] defaultIfNull(long[] array)
null,则返回空数组[],否则返回数组本身。
ArrayUtil.defaultIfNull(null) = [] ArrayUtil.defaultIfNull(new long[0]) = 数组本身 ArrayUtil.defaultIfNull(new long[10]) = 数组本身array 要转换的数组 数组本身或空数组
[]public static int[] defaultIfNull(int[] array)
null,则返回空数组[],否则返回数组本身。
ArrayUtil.defaultIfNull(null) = [] ArrayUtil.defaultIfNull(new int[0]) = 数组本身 ArrayUtil.defaultIfNull(new int[10]) = 数组本身array 要转换的数组 数组本身或空数组
[]public static short[] defaultIfNull(short[] array)
null,则返回空数组[],否则返回数组本身。
ArrayUtil.defaultIfNull(null) = [] ArrayUtil.defaultIfNull(new short[0]) = 数组本身 ArrayUtil.defaultIfNull(new short[10]) = 数组本身array 要转换的数组 数组本身或空数组
[]public static byte[] defaultIfNull(byte[] array)
null,则返回空数组[],否则返回数组本身。
ArrayUtil.defaultIfNull(null) = [] ArrayUtil.defaultIfNull(new byte[0]) = 数组本身 ArrayUtil.defaultIfNull(new byte[10]) = 数组本身array 要转换的数组 数组本身或空数组
[]public static double[] defaultIfNull(double[] array)
null,则返回空数组[],否则返回数组本身。
ArrayUtil.defaultIfNull(null) = [] ArrayUtil.defaultIfNull(new double[0]) = 数组本身 ArrayUtil.defaultIfNull(new double[10]) = 数组本身array 要转换的数组 数组本身或空数组
[]public static float[] defaultIfNull(float[] array)
null,则返回空数组[],否则返回数组本身。
ArrayUtil.defaultIfNull(null) = [] ArrayUtil.defaultIfNull(new float[0]) = 数组本身 ArrayUtil.defaultIfNull(new float[10]) = 数组本身array 要转换的数组 数组本身或空数组
[]public static boolean[] defaultIfNull(boolean[] array)
null,则返回空数组[],否则返回数组本身。
ArrayUtil.defaultIfNull(null) = [] ArrayUtil.defaultIfNull(new boolean[0]) = 数组本身 ArrayUtil.defaultIfNull(new boolean[10]) = 数组本身array 要转换的数组 数组本身或空数组
[]public static char[] defaultIfNull(char[] array)
null,则返回空数组[],否则返回数组本身。
ArrayUtil.defaultIfNull(null) = [] ArrayUtil.defaultIfNull(new char[0]) = 数组本身 ArrayUtil.defaultIfNull(new char[10]) = 数组本身array 要转换的数组 数组本身或空数组
[]public static Object[] defaultIfNull(Object[] array, Object[] defaultArray)
null,则返回指定默认数组,否则返回数组本身。
ArrayUtil.defaultIfNull(null, defaultArray) = defaultArray ArrayUtil.defaultIfNull(new String[0], defaultArray) = 数组本身 ArrayUtil.defaultIfNull(new String[10], defaultArray) = 数组本身array 要转换的数组 defaultArray 默认数组 数组本身或指定的默认数组
public static long[] defaultIfNull(long[] array,
long[] defaultArray)
null,则返回指定默认数组,否则返回数组本身。
ArrayUtil.defaultIfNull(null, defaultArray) = defaultArray ArrayUtil.defaultIfNull(new long[0], defaultArray) = 数组本身 ArrayUtil.defaultIfNull(new long[10], defaultArray) = 数组本身array 要转换的数组 defaultArray 默认数组 数组本身或指定的默认数组
public static int[] defaultIfNull(int[] array,
int[] defaultArray)
null,则返回指定默认数组,否则返回数组本身。
ArrayUtil.defaultIfNull(null, defaultArray) = defaultArray ArrayUtil.defaultIfNull(new int[0], defaultArray) = 数组本身 ArrayUtil.defaultIfNull(new int[10], defaultArray) = 数组本身array 要转换的数组 defaultArray 默认数组 数组本身或指定的默认数组
public static short[] defaultIfNull(short[] array,
short[] defaultArray)
null,则返回指定默认数组,否则返回数组本身。
ArrayUtil.defaultIfNull(null, defaultArray) = defaultArray ArrayUtil.defaultIfNull(new short[0], defaultArray) = 数组本身 ArrayUtil.defaultIfNull(new short[10], defaultArray) = 数组本身array 要转换的数组 defaultArray 默认数组 数组本身或指定的默认数组
public static byte[] defaultIfNull(byte[] array,
byte[] defaultArray)
null,则返回指定默认数组,否则返回数组本身。
ArrayUtil.defaultIfNull(null, defaultArray) = defaultArray ArrayUtil.defaultIfNull(new byte[0], defaultArray) = 数组本身 ArrayUtil.defaultIfNull(new byte[10], defaultArray) = 数组本身array 要转换的数组 defaultArray 默认数组 数组本身或指定的默认数组
public static double[] defaultIfNull(double[] array,
double[] defaultArray)
null,则返回指定默认数组,否则返回数组本身。
ArrayUtil.defaultIfNull(null, defaultArray) = defaultArray ArrayUtil.defaultIfNull(new double[0], defaultArray) = 数组本身 ArrayUtil.defaultIfNull(new double[10], defaultArray) = 数组本身array 要转换的数组 defaultArray 默认数组 数组本身或指定的默认数组
public static float[] defaultIfNull(float[] array,
float[] defaultArray)
null,则返回指定默认数组,否则返回数组本身。
ArrayUtil.defaultIfNull(null, defaultArray) = defaultArray ArrayUtil.defaultIfNull(new float[0], defaultArray) = 数组本身 ArrayUtil.defaultIfNull(new float[10], defaultArray) = 数组本身array 要转换的数组 defaultArray 默认数组 数组本身或指定的默认数组
public static boolean[] defaultIfNull(boolean[] array,
boolean[] defaultArray)
null,则返回指定默认数组,否则返回数组本身。
ArrayUtil.defaultIfNull(null, defaultArray) = defaultArray ArrayUtil.defaultIfNull(new boolean[0], defaultArray) = 数组本身 ArrayUtil.defaultIfNull(new boolean[10], defaultArray) = 数组本身array 要转换的数组 defaultArray 默认数组 数组本身或指定的默认数组
public static char[] defaultIfNull(char[] array,
char[] defaultArray)
null,则返回指定默认数组,否则返回数组本身。
ArrayUtil.defaultIfNull(null, defaultArray) = defaultArray ArrayUtil.defaultIfNull(new char[0], defaultArray) = 数组本身 ArrayUtil.defaultIfNull(new char[10], defaultArray) = 数组本身array 要转换的数组 defaultArray 默认数组 数组本身或指定的默认数组
public static Object[] defaultIfNull(Object[] array, Class defaultComponentType)
null,则返回指定元素类型的空数组,否则返回数组本身。
ArrayUtil.defaultIfNull(null, String.class) = new String[0] ArrayUtil.defaultIfNull(new String[0], String.class) = 数组本身 ArrayUtil.defaultIfNull(new String[10], String.class) = 数组本身array 要转换的数组 defaultComponentType 默认数组的元素类型 数组本身或指定类型的空数组
public static Object[] defaultIfEmpty(Object[] array)
null或空数组[],则返回空数组[],否则返回数组本身。
此方法实际上和defaultIfNull(Object[])等效。
ArrayUtil.defaultIfEmpty(null) = [] ArrayUtil.defaultIfEmpty(new String[0]) = 数组本身 ArrayUtil.defaultIfEmpty(new String[10]) = 数组本身array 要转换的数组 数组本身或空数组
[]public static long[] defaultIfEmpty(long[] array)
null或空数组[],则返回空数组[],否则返回数组本身。
此方法实际上和defaultIfNull(Object[])等效。
ArrayUtil.defaultIfEmpty(null) = [] ArrayUtil.defaultIfEmpty(new long[0]) = 数组本身 ArrayUtil.defaultIfEmpty(new long[10]) = 数组本身array 要转换的数组 数组本身或空数组
[]public static int[] defaultIfEmpty(int[] array)
null或空数组[],则返回空数组[],否则返回数组本身。
此方法实际上和defaultIfNull(Object[])等效。
ArrayUtil.defaultIfEmpty(null) = [] ArrayUtil.defaultIfEmpty(new int[0]) = 数组本身 ArrayUtil.defaultIfEmpty(new int[10]) = 数组本身array 要转换的数组 数组本身或空数组
[]public static short[] defaultIfEmpty(short[] array)
null或空数组[],则返回空数组[],否则返回数组本身。
此方法实际上和defaultIfNull(Object[])等效。
ArrayUtil.defaultIfEmpty(null) = [] ArrayUtil.defaultIfEmpty(new short[0]) = 数组本身 ArrayUtil.defaultIfEmpty(new short[10]) = 数组本身array 要转换的数组 数组本身或空数组
[]public static byte[] defaultIfEmpty(byte[] array)
null或空数组[],则返回空数组[],否则返回数组本身。
此方法实际上和defaultIfNull(Object[])等效。
ArrayUtil.defaultIfEmpty(null) = [] ArrayUtil.defaultIfEmpty(new byte[0]) = 数组本身 ArrayUtil.defaultIfEmpty(new byte[10]) = 数组本身array 要转换的数组 数组本身或空数组
[]public static double[] defaultIfEmpty(double[] array)
null或空数组[],则返回空数组[],否则返回数组本身。
此方法实际上和defaultIfNull(Object[])等效。
ArrayUtil.defaultIfEmpty(null) = [] ArrayUtil.defaultIfEmpty(new double[0]) = 数组本身 ArrayUtil.defaultIfEmpty(new double[10]) = 数组本身array 要转换的数组 数组本身或空数组
[]public static float[] defaultIfEmpty(float[] array)
null或空数组[],则返回空数组[],否则返回数组本身。
此方法实际上和defaultIfNull(Object[])等效。
ArrayUtil.defaultIfEmpty(null) = [] ArrayUtil.defaultIfEmpty(new float[0]) = 数组本身 ArrayUtil.defaultIfEmpty(new float[10]) = 数组本身array 要转换的数组 数组本身或空数组
[]public static boolean[] defaultIfEmpty(boolean[] array)
null或空数组[],则返回空数组[],否则返回数组本身。
此方法实际上和defaultIfNull(Object[])等效。
ArrayUtil.defaultIfEmpty(null) = [] ArrayUtil.defaultIfEmpty(new boolean[0]) = 数组本身 ArrayUtil.defaultIfEmpty(new boolean[10]) = 数组本身array 要转换的数组 数组本身或空数组
[]public static char[] defaultIfEmpty(char[] array)
null或空数组[],则返回空数组[],否则返回数组本身。
此方法实际上和defaultIfNull(Object[])等效。
ArrayUtil.defaultIfEmpty(null) = [] ArrayUtil.defaultIfEmpty(new char[0]) = 数组本身 ArrayUtil.defaultIfEmpty(new char[10]) = 数组本身array 要转换的数组 数组本身或空数组
[]public static Object[] defaultIfEmpty(Object[] array, Object[] defaultArray)
null或空数组[],则返回指定默认数组,否则返回数组本身。
ArrayUtil.defaultIfEmpty(null, defaultArray) = defaultArray ArrayUtil.defaultIfEmpty(new String[0], defaultArray) = defaultArray ArrayUtil.defaultIfEmpty(new String[10], defaultArray) = 数组本身array 要转换的数组 defaultArray 默认数组 数组本身或指定的默认数组
public static long[] defaultIfEmpty(long[] array,
long[] defaultArray)
null或空数组[],则返回指定默认数组,否则返回数组本身。
ArrayUtil.defaultIfEmpty(null, defaultArray) = defaultArray ArrayUtil.defaultIfEmpty(new long[0], defaultArray) = defaultArray ArrayUtil.defaultIfEmpty(new long[10], defaultArray) = 数组本身array 要转换的数组 defaultArray 默认数组 数组本身或指定的默认数组
public static int[] defaultIfEmpty(int[] array,
int[] defaultArray)
null或空数组[],则返回指定默认数组,否则返回数组本身。
ArrayUtil.defaultIfEmpty(null, defaultArray) = defaultArray ArrayUtil.defaultIfEmpty(new int[0], defaultArray) = defaultArray ArrayUtil.defaultIfEmpty(new int[10], defaultArray) = 数组本身array 要转换的数组 defaultArray 默认数组 数组本身或指定的默认数组
public static short[] defaultIfEmpty(short[] array,
short[] defaultArray)
null或空数组[],则返回指定默认数组,否则返回数组本身。
ArrayUtil.defaultIfEmpty(null, defaultArray) = defaultArray ArrayUtil.defaultIfEmpty(new short[0], defaultArray) = defaultArray ArrayUtil.defaultIfEmpty(new short[10], defaultArray) = 数组本身array 要转换的数组 defaultArray 默认数组 数组本身或指定的默认数组
public static byte[] defaultIfEmpty(byte[] array,
byte[] defaultArray)
null或空数组[],则返回指定默认数组,否则返回数组本身。
ArrayUtil.defaultIfEmpty(null, defaultArray) = defaultArray ArrayUtil.defaultIfEmpty(new byte[0], defaultArray) = defaultArray ArrayUtil.defaultIfEmpty(new byte[10], defaultArray) = 数组本身array 要转换的数组 defaultArray 默认数组 数组本身或指定的默认数组
public static double[] defaultIfEmpty(double[] array,
double[] defaultArray)
null或空数组[],则返回指定默认数组,否则返回数组本身。
ArrayUtil.defaultIfEmpty(null, defaultArray) = defaultArray ArrayUtil.defaultIfEmpty(new double[0], defaultArray) = defaultArray ArrayUtil.defaultIfEmpty(new double[10], defaultArray) = 数组本身array 要转换的数组 defaultArray 默认数组 数组本身或指定的默认数组
public static float[] defaultIfEmpty(float[] array,
float[] defaultArray)
null或空数组[],则返回指定默认数组,否则返回数组本身。
ArrayUtil.defaultIfEmpty(null, defaultArray) = defaultArray ArrayUtil.defaultIfEmpty(new float[0], defaultArray) = defaultArray ArrayUtil.defaultIfEmpty(new float[10], defaultArray) = 数组本身array 要转换的数组 defaultArray 默认数组 数组本身或指定的默认数组
public static boolean[] defaultIfEmpty(boolean[] array,
boolean[] defaultArray)
null或空数组[],则返回指定默认数组,否则返回数组本身。
ArrayUtil.defaultIfEmpty(null, defaultArray) = defaultArray ArrayUtil.defaultIfEmpty(new boolean[0], defaultArray) = defaultArray ArrayUtil.defaultIfEmpty(new boolean[10], defaultArray) = 数组本身array 要转换的数组 defaultArray 默认数组 数组本身或指定的默认数组
public static char[] defaultIfEmpty(char[] array,
char[] defaultArray)
null或空数组[],则返回指定默认数组,否则返回数组本身。
ArrayUtil.defaultIfEmpty(null, defaultArray) = defaultArray ArrayUtil.defaultIfEmpty(new char[0], defaultArray) = defaultArray ArrayUtil.defaultIfEmpty(new char[10], defaultArray) = 数组本身array 要转换的数组 defaultArray 默认数组 数组本身或指定的默认数组
public static Object[] defaultIfEmpty(Object[] array, Class defaultComponentType)
null或空数组[],则返回指定元素类型的空数组,否则返回数组本身。
ArrayUtil.defaultIfNull(null, String.class) = new String[0] ArrayUtil.defaultIfNull(new String[0], String.class) = new String[0] ArrayUtil.defaultIfNull(new String[10], String.class) = 数组本身array 要转换的数组 defaultComponentType 默认数组的元素类型 数组本身或指定类型的空数组
public static boolean equals(Object array1, Object array2)
ObjectUtil.equals。
array1 数组1
array2 数组2
如果相等, 则返回truepublic static int hashCode(Object array)
null, 则返回0。
如果对象不是数组,则此方法的结果同ObjectUtil.hashCode。
array 数组
hash值public static List toFixedList(Object[] array)
List,当改变这个List中的值时。数组中的相应值也被改变。
如果输入数组为null,则返回null。
该方法内部调用java.util.Arrays.asList方法所返回的列表为指定数组的映像(固定长度),因此性能和内存占用上比toList方法更优。
这个方法常被用于初始化,例如:
List myList = ArrayUtil.toFixedList(new String[] { "aaa", "bbb", "ccc" });
array 要转换的数组
以数组本身为映射的listpublic static List toList(Object array)
List。
如果输入数组为null,则返回null。
该方法返回的列表为指定数组的复本,而java.util.Arrays.asList方法所返回的列表为指定数组的映像(固定长度)。
这个方法常被用于初始化,例如:
List myList = ArrayUtil.toList(new String[] { "aaa", "bbb", "ccc" });
List singleList = ArrayUtil.toList("hello"); // 返回单个元素的列表["hello"]
array 要转换的数组
被创建的listpublic static List toList(Object array, List list)
List。
如果输入数组为null,则返回null。
该方法返回的列表为指定数组的复本,而java.util.Arrays.asList方法所返回的列表为指定数组的映像(固定长度)。
这个方法常被用于初始化,例如:
List myList = ArrayUtil.toList(new String[] { "aaa", "bbb", "ccc" }, new ArrayList());
List singleList = ArrayUtil.toList("hello", new ArrayList()); // 返回单个元素的列表["hello"]
array 要转换的数组
list 要填充的列表,如果是null,则创建之
被创建或填充的listpublic static Map toMap(Object[] array)
Map。数组的元素必须是Map.Entry或元素个数多于2的子数组。
如果输入数组为null,则返回null。
这个方法常被用于初始化,例如:
Map colorMap = ArrayUtil.toMap(new String[][] {
{"RED", "#FF0000"},
{"GREEN", "#00FF00"},
{"BLUE", "#0000FF"}});
array 要转换的数组
被创建的map
IllegalArgumentException 如果有一个子数组元素个数小于2或不是Map.Entry实例public static Map toMap(Object[] array, Map map)
Map。数组的元素必须是Map.Entry或元素个数多于2的子数组。
如果输入数组为null,则返回null。
这个方法常被用于初始化,例如:
Map colorMap = ArrayUtil.toMap(new String[][] {{
{"RED", "#FF0000"},
{"GREEN", "#00FF00"},
{"BLUE", "#0000FF"}}, new HashMap());
array 要转换的数组
map 要填充的map,如果为null则自动创建之
被创建或填充的map
IllegalArgumentException 如果有一个子数组元素个数小于2或不是Map.Entry实例public static Object[] clone(Object[] array)
null,则返回null。
此方法只进行“浅复制”,也就是说,数组中的对象本身不会被复制。 另外,此方法也不处理多维数组。
array 要复制的数组
数组的复本,如果原始数组为null,则返回nullpublic static long[] clone(long[] array)
null,则返回null。
此方法也不处理多维数组。
array 要复制的数组
数组的复本,如果原始数组为null,则返回nullpublic static int[] clone(int[] array)
null,则返回null。
此方法也不处理多维数组。
array 要复制的数组
数组的复本,如果原始数组为null,则返回nullpublic static short[] clone(short[] array)
null,则返回null。
此方法也不处理多维数组。
array 要复制的数组
数组的复本,如果原始数组为null,则返回nullpublic static byte[] clone(byte[] array)
null,则返回null。
此方法也不处理多维数组。
array 要复制的数组
数组的复本,如果原始数组为null,则返回nullpublic static double[] clone(double[] array)
null,则返回null。
此方法也不处理多维数组。
array 要复制的数组
数组的复本,如果原始数组为null,则返回nullpublic static float[] clone(float[] array)
null,则返回null。
此方法也不处理多维数组。
array 要复制的数组
数组的复本,如果原始数组为null,则返回nullpublic static boolean[] clone(boolean[] array)
null,则返回null。
此方法也不处理多维数组。
array 要复制的数组
数组的复本,如果原始数组为null,则返回nullpublic static char[] clone(char[] array)
null,则返回null。
此方法也不处理多维数组。
array 要复制的数组
数组的复本,如果原始数组为null,则返回nullpublic static boolean isSameLength(Object[] array1, Object[] array2)
null则被看作长度为0。
array1 数组1
array2 数组2
如果两个数组长度相同,则返回truepublic static boolean isSameLength(long[] array1,
long[] array2)
null则被看作长度为0。
array1 数组1
array2 数组2
如果两个数组长度相同,则返回truepublic static boolean isSameLength(int[] array1,
int[] array2)
null则被看作长度为0。
array1 数组1
array2 数组2
如果两个数组长度相同,则返回truepublic static boolean isSameLength(short[] array1,
short[] array2)
null则被看作长度为0。
array1 数组1
array2 数组2
如果两个数组长度相同,则返回truepublic static boolean isSameLength(byte[] array1,
byte[] array2)
null则被看作长度为0。
array1 数组1
array2 数组2
如果两个数组长度相同,则返回truepublic static boolean isSameLength(double[] array1,
double[] array2)
null则被看作长度为0。
array1 数组1
array2 数组2
如果两个数组长度相同,则返回truepublic static boolean isSameLength(float[] array1,
float[] array2)
null则被看作长度为0。
array1 数组1
array2 数组2
如果两个数组长度相同,则返回truepublic static boolean isSameLength(boolean[] array1,
boolean[] array2)
null则被看作长度为0。
array1 数组1
array2 数组2
如果两个数组长度相同,则返回truepublic static boolean isSameLength(char[] array1,
char[] array2)
null则被看作长度为0。
array1 数组1
array2 数组2
如果两个数组长度相同,则返回truepublic static void reverse(Object[] array)
null,则什么也不做。
array 要反转的数组public static void reverse(long[] array)
null,则什么也不做。
array 要反转的数组public static void reverse(int[] array)
null,则什么也不做。
array 要反转的数组public static void reverse(short[] array)
null,则什么也不做。
array 要反转的数组public static void reverse(byte[] array)
null,则什么也不做。
array 要反转的数组public static void reverse(double[] array)
null,则什么也不做。
array 要反转的数组public static void reverse(float[] array)
null,则什么也不做。
array 要反转的数组public static void reverse(boolean[] array)
null,则什么也不做。
array 要反转的数组public static void reverse(char[] array)
null,则什么也不做。
array 要反转的数组public static int indexOf(Object[] array, Object objectToFind)
null则返回-1。
array 要扫描的数组
objectToFind 要查找的元素
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(Object[] array, Object[] arrayToFind)
null则返回-1。
array 要扫描的数组
arrayToFind 要查找的元素序列
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(Object[] array, Object objectToFind, int startIndex)
null则返回-1。
起始索引小于0则看作0,超出数组长度的起始索引则返回-1。
array 要扫描的数组
objectToFind 要查找的元素
startIndex 起始索引
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(Object[] array, Object[] arrayToFind, int startIndex)
null则返回-1。
起始索引小于0则看作0,超出数组长度的起始索引则返回-1。
array 要扫描的数组
arrayToFind 要查找的元素序列
startIndex 起始索引
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(Object[] array, Object objectToFind)
null则返回-1。
array 要扫描的数组
objectToFind 要查找的元素
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(Object[] array, Object[] arrayToFind)
null则返回-1。
array 要扫描的数组
arrayToFind 要查找的元素序列
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(Object[] array, Object objectToFind, int startIndex)
null则返回-1。
起始索引小于0则返回-1,超出数组长度的起始索引则从数组末尾开始找。
array 要扫描的数组
objectToFind 要查找的元素
startIndex 起始索引
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(Object[] array, Object[] arrayToFind, int startIndex)
null则返回-1。
起始索引小于0则返回-1,超出数组长度的起始索引则从数组末尾开始找。
array 要扫描的数组
arrayToFind 要查找的元素序列
startIndex 起始索引
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static boolean contains(Object[] array, Object objectToFind)
null则返回false。
array 要扫描的数组
objectToFind 要查找的元素
如果找到则返回truepublic static boolean contains(Object[] array, Object[] arrayToFind)
null则返回false。
array 要扫描的数组
arrayToFind 要查找的元素序列
如果找到则返回truepublic static int indexOf(long[] array,
long longToFind)
null则返回-1。
array 要扫描的数组
longToFind 要查找的元素
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(long[] array,
long[] arrayToFind)
null则返回-1。
array 要扫描的数组
arrayToFind 要查找的元素序列
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(long[] array,
long longToFind,
int startIndex)
null则返回-1。
起始索引小于0则看作0,超出数组长度的起始索引则返回-1。
array 要扫描的数组
longToFind 要查找的元素
startIndex 起始索引
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(long[] array,
long[] arrayToFind,
int startIndex)
null则返回-1。
起始索引小于0则看作0,超出数组长度的起始索引则返回-1。
array 要扫描的数组
arrayToFind 要查找的元素序列
startIndex 起始索引
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(long[] array,
long longToFind)
null则返回-1。
array 要扫描的数组
longToFind 要查找的元素
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(long[] array,
long[] arrayToFind)
null则返回-1。
array 要扫描的数组
arrayToFind 要查找的元素序列
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(long[] array,
long longToFind,
int startIndex)
null则返回-1。
起始索引小于0则返回-1,超出数组长度的起始索引则从数组末尾开始找。
array 要扫描的数组
longToFind 要查找的元素
startIndex 起始索引
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(long[] array,
long[] arrayToFind,
int startIndex)
null则返回-1。
起始索引小于0则返回-1,超出数组长度的起始索引则从数组末尾开始找。
array 要扫描的数组
arrayToFind 要查找的元素序列
startIndex 起始索引
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static boolean contains(long[] array,
long longToFind)
null则返回false。
array 要扫描的数组
longToFind 要查找的元素
如果找到则返回truepublic static boolean contains(long[] array,
long[] arrayToFind)
null则返回false。
array 要扫描的数组
arrayToFind 要查找的元素序列
如果找到则返回truepublic static int indexOf(int[] array,
int intToFind)
null则返回-1。
array 要扫描的数组
intToFind 要查找的元素
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(int[] array,
int[] arrayToFind)
null则返回-1。
array 要扫描的数组
arrayToFind 要查找的元素序列
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(int[] array,
int intToFind,
int startIndex)
null则返回-1。
起始索引小于0则看作0,超出数组长度的起始索引则返回-1。
array 要扫描的数组
intToFind 要查找的元素
startIndex 起始索引
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(int[] array,
int[] arrayToFind,
int startIndex)
null则返回-1。
起始索引小于0则看作0,超出数组长度的起始索引则返回-1。
array 要扫描的数组
arrayToFind 要查找的元素序列
startIndex 起始索引
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(int[] array,
int intToFind)
null则返回-1。
array 要扫描的数组
intToFind 要查找的元素
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(int[] array,
int[] arrayToFind)
null则返回-1。
array 要扫描的数组
arrayToFind 要查找的元素序列
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(int[] array,
int intToFind,
int startIndex)
null则返回-1。
起始索引小于0则返回-1,超出数组长度的起始索引则从数组末尾开始找。
array 要扫描的数组
intToFind 要查找的元素
startIndex 起始索引
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(int[] array,
int[] arrayToFind,
int startIndex)
null则返回-1。
起始索引小于0则返回-1,超出数组长度的起始索引则从数组末尾开始找。
array 要扫描的数组
arrayToFind 要查找的元素序列
startIndex 起始索引
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static boolean contains(int[] array,
int intToFind)
null则返回false。
array 要扫描的数组
intToFind 要查找的元素
如果找到则返回truepublic static boolean contains(int[] array,
int[] arrayToFind)
null则返回false。
array 要扫描的数组
arrayToFind 要查找的元素序列
如果找到则返回truepublic static int indexOf(short[] array,
short shortToFind)
null则返回-1。
array 要扫描的数组
shortToFind 要查找的元素
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(short[] array,
short[] arrayToFind)
null则返回-1。
array 要扫描的数组
arrayToFind 要查找的元素序列
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(short[] array,
short shortToFind,
int startIndex)
null则返回-1。
起始索引小于0则看作0,超出数组长度的起始索引则返回-1。
array 要扫描的数组
shortToFind 要查找的元素
startIndex 起始索引
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(short[] array,
short[] arrayToFind,
int startIndex)
null则返回-1。
起始索引小于0则看作0,超出数组长度的起始索引则返回-1。
array 要扫描的数组
arrayToFind 要查找的元素序列
startIndex 起始索引
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(short[] array,
short shortToFind)
null则返回-1。
array 要扫描的数组
shortToFind 要查找的元素
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(short[] array,
short[] arrayToFind)
null则返回-1。
array 要扫描的数组
arrayToFind 要查找的元素序列
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(short[] array,
short shortToFind,
int startIndex)
null则返回-1。
起始索引小于0则返回-1,超出数组长度的起始索引则从数组末尾开始找。
array 要扫描的数组
shortToFind 要查找的元素
startIndex 起始索引
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(short[] array,
short[] arrayToFind,
int startIndex)
null则返回-1。
起始索引小于0则返回-1,超出数组长度的起始索引则从数组末尾开始找。
array 要扫描的数组
arrayToFind 要查找的元素序列
startIndex 起始索引
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static boolean contains(short[] array,
short shortToFind)
null则返回false。
array 要扫描的数组
shortToFind 要查找的元素
如果找到则返回truepublic static boolean contains(short[] array,
short[] arrayToFind)
null则返回false。
array 要扫描的数组
arrayToFind 要查找的元素序列
如果找到则返回truepublic static int indexOf(byte[] array,
byte byteToFind)
null则返回-1。
array 要扫描的数组
byteToFind 要查找的元素
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(byte[] array,
byte[] arrayToFind)
null则返回-1。
array 要扫描的数组
arrayToFind 要查找的元素序列
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(byte[] array,
byte byteToFind,
int startIndex)
null则返回-1。
起始索引小于0则看作0,超出数组长度的起始索引则返回-1。
array 要扫描的数组
byteToFind 要查找的元素
startIndex 起始索引
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(byte[] array,
byte[] arrayToFind,
int startIndex)
null则返回-1。
起始索引小于0则看作0,超出数组长度的起始索引则返回-1。
array 要扫描的数组
arrayToFind 要查找的元素序列
startIndex 起始索引
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(byte[] array,
byte byteToFind)
null则返回-1。
array 要扫描的数组
byteToFind 要查找的元素
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(byte[] array,
byte[] arrayToFind)
null则返回-1。
array 要扫描的数组
arrayToFind 要查找的元素序列
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(byte[] array,
byte byteToFind,
int startIndex)
null则返回-1。
起始索引小于0则返回-1,超出数组长度的起始索引则从数组末尾开始找。
array 要扫描的数组
byteToFind 要查找的元素
startIndex 起始索引
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(byte[] array,
byte[] arrayToFind,
int startIndex)
null则返回-1。
起始索引小于0则返回-1,超出数组长度的起始索引则从数组末尾开始找。
array 要扫描的数组
arrayToFind 要查找的元素序列
startIndex 起始索引
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static boolean contains(byte[] array,
byte byteToFind)
null则返回false。
array 要扫描的数组
byteToFind 要查找的元素
如果找到则返回truepublic static boolean contains(byte[] array,
byte[] arrayToFind)
null则返回false。
array 要扫描的数组
arrayToFind 要查找的元素序列
如果找到则返回truepublic static int indexOf(double[] array,
double doubleToFind)
null则返回-1。
array 要扫描的数组
doubleToFind 要查找的元素
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(double[] array,
double doubleToFind,
double tolerance)
null则返回-1。
array 要扫描的数组
doubleToFind 要查找的元素
tolerance 误差
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(double[] array,
double[] arrayToFind)
null则返回-1。
array 要扫描的数组
arrayToFind 要查找的元素序列
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(double[] array,
double[] arrayToFind,
double tolerance)
null则返回-1。
array 要扫描的数组
arrayToFind 要查找的元素序列
tolerance 误差
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(double[] array,
double doubleToFind,
int startIndex)
null则返回-1。
起始索引小于0则看作0,超出数组长度的起始索引则返回-1。
array 要扫描的数组
doubleToFind 要查找的元素
startIndex 起始索引
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(double[] array,
double doubleToFind,
int startIndex,
double tolerance)
null则返回-1。
起始索引小于0则看作0,超出数组长度的起始索引则返回-1。
array 要扫描的数组
doubleToFind 要查找的元素
startIndex 起始索引
tolerance 误差
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(double[] array,
double[] arrayToFind,
int startIndex)
null则返回-1。
起始索引小于0则看作0,超出数组长度的起始索引则返回-1。
array 要扫描的数组
arrayToFind 要查找的元素序列
startIndex 起始索引
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(double[] array,
double[] arrayToFind,
int startIndex,
double tolerance)
null则返回-1。
起始索引小于0则看作0,超出数组长度的起始索引则返回-1。
array 要扫描的数组
arrayToFind 要查找的元素序列
startIndex 起始索引
tolerance 误差
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(double[] array,
double doubleToFind)
null则返回-1。
array 要扫描的数组
doubleToFind 要查找的元素
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(double[] array,
double doubleToFind,
double tolerance)
null则返回-1。
array 要扫描的数组
doubleToFind 要查找的元素
tolerance 误差
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(double[] array,
double[] arrayToFind)
null则返回-1。
array 要扫描的数组
arrayToFind 要查找的元素序列
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(double[] array,
double[] arrayToFind,
double tolerance)
null则返回-1。
array 要扫描的数组
arrayToFind 要查找的元素序列
tolerance 误差
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(double[] array,
double doubleToFind,
int startIndex)
null则返回-1。
起始索引小于0则返回-1,超出数组长度的起始索引则从数组末尾开始找。
array 要扫描的数组
doubleToFind 要查找的元素
startIndex 起始索引
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(double[] array,
double doubleToFind,
int startIndex,
double tolerance)
null则返回-1。
起始索引小于0则返回-1,超出数组长度的起始索引则从数组末尾开始找。
array 要扫描的数组
doubleToFind 要查找的元素
startIndex 起始索引
tolerance 误差
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(double[] array,
double[] arrayToFind,
int startIndex)
null则返回-1。
起始索引小于0则返回-1,超出数组长度的起始索引则从数组末尾开始找。
array 要扫描的数组
arrayToFind 要查找的元素序列
startIndex 起始索引
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(double[] array,
double[] arrayToFind,
int startIndex,
double tolerance)
null则返回-1。
起始索引小于0则返回-1,超出数组长度的起始索引则从数组末尾开始找。
array 要扫描的数组
arrayToFind 要查找的元素序列
startIndex 起始索引
tolerance 误差
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static boolean contains(double[] array,
double doubleToFind)
null则返回false。
array 要扫描的数组
doubleToFind 要查找的元素
如果找到则返回truepublic static boolean contains(double[] array,
double doubleToFind,
double tolerance)
null则返回false。
array 要扫描的数组
doubleToFind 要查找的元素
tolerance 误差
如果找到则返回truepublic static boolean contains(double[] array,
double[] arrayToFind)
null则返回false。
array 要扫描的数组
arrayToFind 要查找的元素序列
如果找到则返回truepublic static boolean contains(double[] array,
double[] arrayToFind,
double tolerance)
null则返回false。
array 要扫描的数组
arrayToFind 要查找的元素序列
tolerance 误差
如果找到则返回truepublic static int indexOf(float[] array,
float floatToFind)
null则返回-1。
array 要扫描的数组
floatToFind 要查找的元素
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(float[] array,
float floatToFind,
float tolerance)
null则返回-1。
array 要扫描的数组
floatToFind 要查找的元素
tolerance 误差
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(float[] array,
float[] arrayToFind)
null则返回-1。
array 要扫描的数组
arrayToFind 要查找的元素序列
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(float[] array,
float[] arrayToFind,
float tolerance)
null则返回-1。
array 要扫描的数组
arrayToFind 要查找的元素序列
tolerance 误差
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(float[] array,
float floatToFind,
int startIndex)
null则返回-1。
起始索引小于0则看作0,超出数组长度的起始索引则返回-1。
array 要扫描的数组
floatToFind 要查找的元素
startIndex 起始索引
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(float[] array,
float floatToFind,
int startIndex,
float tolerance)
null则返回-1。
起始索引小于0则看作0,超出数组长度的起始索引则返回-1。
array 要扫描的数组
floatToFind 要查找的元素
startIndex 起始索引
tolerance 误差
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(float[] array,
float[] arrayToFind,
int startIndex)
null则返回-1。
起始索引小于0则看作0,超出数组长度的起始索引则返回-1。
array 要扫描的数组
arrayToFind 要查找的元素序列
startIndex 起始索引
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(float[] array,
float[] arrayToFind,
int startIndex,
float tolerance)
null则返回-1。
起始索引小于0则看作0,超出数组长度的起始索引则返回-1。
array 要扫描的数组
arrayToFind 要查找的元素序列
startIndex 起始索引
tolerance 误差
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(float[] array,
float floatToFind)
null则返回-1。
array 要扫描的数组
floatToFind 要查找的元素
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(float[] array,
float floatToFind,
float tolerance)
null则返回-1。
array 要扫描的数组
floatToFind 要查找的元素
tolerance 误差
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(float[] array,
float[] arrayToFind)
null则返回-1。
array 要扫描的数组
arrayToFind 要查找的元素序列
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(float[] array,
float[] arrayToFind,
float tolerance)
null则返回-1。
array 要扫描的数组
arrayToFind 要查找的元素序列
tolerance 误差
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(float[] array,
float floatToFind,
int startIndex)
null则返回-1。
起始索引小于0则返回-1,超出数组长度的起始索引则从数组末尾开始找。
array 要扫描的数组
floatToFind 要查找的元素
startIndex 起始索引
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(float[] array,
float floatToFind,
int startIndex,
float tolerance)
null则返回-1。
起始索引小于0则返回-1,超出数组长度的起始索引则从数组末尾开始找。
array 要扫描的数组
floatToFind 要查找的元素
startIndex 起始索引
tolerance 误差
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(float[] array,
float[] arrayToFind,
int startIndex)
null则返回-1。
起始索引小于0则返回-1,超出数组长度的起始索引则从数组末尾开始找。
array 要扫描的数组
arrayToFind 要查找的元素序列
startIndex 起始索引
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(float[] array,
float[] arrayToFind,
int startIndex,
float tolerance)
null则返回-1。
起始索引小于0则返回-1,超出数组长度的起始索引则从数组末尾开始找。
array 要扫描的数组
arrayToFind 要查找的元素序列
startIndex 起始索引
tolerance 误差
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static boolean contains(float[] array,
float floatToFind)
null则返回false。
array 要扫描的数组
floatToFind 要查找的元素
如果找到则返回truepublic static boolean contains(float[] array,
float floatToFind,
float tolerance)
null则返回false。
array 要扫描的数组
floatToFind 要查找的元素
tolerance 误差
如果找到则返回truepublic static boolean contains(float[] array,
float[] arrayToFind)
null则返回false。
array 要扫描的数组
arrayToFind 要查找的元素序列
如果找到则返回truepublic static boolean contains(float[] array,
float[] arrayToFind,
float tolerance)
null则返回false。
array 要扫描的数组
arrayToFind 要查找的元素序列
tolerance 误差
如果找到则返回truepublic static int indexOf(boolean[] array,
boolean booleanToFind)
null则返回-1。
array 要扫描的数组
booleanToFind 要查找的元素
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(boolean[] array,
boolean[] arrayToFind)
null则返回-1。
array 要扫描的数组
arrayToFind 要查找的元素序列
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(boolean[] array,
boolean booleanToFind,
int startIndex)
null则返回-1。
起始索引小于0则看作0,超出数组长度的起始索引则返回-1。
array 要扫描的数组
booleanToFind 要查找的元素
startIndex 起始索引
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(boolean[] array,
boolean[] arrayToFind,
int startIndex)
null则返回-1。
起始索引小于0则看作0,超出数组长度的起始索引则返回-1。
array 要扫描的数组
arrayToFind 要查找的元素序列
startIndex 起始索引
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(boolean[] array,
boolean booleanToFind)
null则返回-1。
array 要扫描的数组
booleanToFind 要查找的元素
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(boolean[] array,
boolean[] arrayToFind)
null则返回-1。
array 要扫描的数组
arrayToFind 要查找的元素序列
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(boolean[] array,
boolean booleanToFind,
int startIndex)
null则返回-1。
起始索引小于0则返回-1,超出数组长度的起始索引则从数组末尾开始找。
array 要扫描的数组
booleanToFind 要查找的元素
startIndex 起始索引
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(boolean[] array,
boolean[] arrayToFind,
int startIndex)
null则返回-1。
起始索引小于0则返回-1,超出数组长度的起始索引则从数组末尾开始找。
array 要扫描的数组
arrayToFind 要查找的元素序列
startIndex 起始索引
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static boolean contains(boolean[] array,
boolean booleanToFind)
null则返回false。
array 要扫描的数组
booleanToFind 要查找的元素
如果找到则返回truepublic static boolean contains(boolean[] array,
boolean[] arrayToFind)
null则返回false。
array 要扫描的数组
arrayToFind 要查找的元素序列
如果找到则返回truepublic static int indexOf(char[] array,
char charToFind)
null则返回-1。
array 要扫描的数组
charToFind 要查找的元素
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(char[] array,
char[] arrayToFind)
null则返回-1。
array 要扫描的数组
arrayToFind 要查找的元素序列
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(char[] array,
char charToFind,
int startIndex)
null则返回-1。
起始索引小于0则看作0,超出数组长度的起始索引则返回-1。
array 要扫描的数组
charToFind 要查找的元素
startIndex 起始索引
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int indexOf(char[] array,
char[] arrayToFind,
int startIndex)
null则返回-1。
起始索引小于0则看作0,超出数组长度的起始索引则返回-1。
array 要扫描的数组
arrayToFind 要查找的元素序列
startIndex 起始索引
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(char[] array,
char charToFind)
null则返回-1。
array 要扫描的数组
charToFind 要查找的元素
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(char[] array,
char[] arrayToFind)
null则返回-1。
array 要扫描的数组
arrayToFind 要查找的元素序列
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(char[] array,
char charToFind,
int startIndex)
null则返回-1。
起始索引小于0则返回-1,超出数组长度的起始索引则从数组末尾开始找。
array 要扫描的数组
charToFind 要查找的元素
startIndex 起始索引
该元素在数组中的序号,如果数组为null或未找到,则返回-1。public static int lastIndexOf(char[] array,
char[] arrayToFind,
int startIndex)
null则返回-1。
起始索引小于0则返回-1,超出数组长度的起始索引则从数组末尾开始找。
array 要扫描的数组
arrayToFind 要查找的元素序列
startIndex 起始索引
该元素序列在数组中的序号,如果数组为null或未找到,则返回-1。public static boolean contains(char[] array,
char charToFind)
null则返回false。
array 要扫描的数组
charToFind 要查找的元素
如果找到则返回truepublic static boolean contains(char[] array,
char[] arrayToFind)
null则返回false。
array 要扫描的数组
arrayToFind 要查找的元素序列
如果找到则返回truepublic static String toString(Object array)
"[]"表示空数组或nullpublic static String toString(Object array, String nullArrayStr)
null,则返回此字符串
字符串表示,或返回指定字符串表示nullpublic static String toString(Object array, String nullArrayStr, String nullElementStr)
null则返回指定字符串,支持多维数组。 如果数组元素为null,则显示指定字符串。
ArrayUtil.toString(null, "null", "NULL") = "null"
ArrayUtil.toString(new int[] {1, 2, 3}, "null", "NULL") = "[1, 2, 3]"
ArrayUtil.toString(new boolean[] {true, false, true}, "null", "NULL") = "[true, false, true]"
ArrayUtil.toString(new Object[] {
{1, 2, 3}, // 嵌套数组
hello, // 嵌套非数组
null, // 嵌套null
{}, // 嵌套空数组
{2, 3, 4} // 嵌套数组
}, "null", "NULL") = "[[1, 2, 3], hello, NULL, [], [2, 3, 4]]"
array 要转换的数组
nullArrayStr 如果数组是null,则返回此字符串
nullElementStr 如果数组中的元素为null,则返回此字符串
字符串表示,或返回指定字符串表示nullCopyright © 2018. All rights reserved.