public final class ArrayUtil extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> ArrayList<T> |
add(ArrayList<T> cur,
T val) |
static <T> T[] |
aheadElement(Class<T> kind,
T[] array,
T element) |
static <T> T[] |
appendElement(Class<T> kind,
T[] array,
T element) |
static <T> boolean |
contains(ArrayList<T> cur,
T val) |
static boolean |
contains(int[] array,
int value) |
static boolean |
contains(long[] array,
long value) |
static <T> boolean |
contains(T[] array,
T value)
Checks that value is present as at least one of the elements of the array.
|
static <T> boolean |
containsAll(T[] array,
T[] check)
Test if all
check items are contained in array. |
static boolean |
equals(byte[] array1,
byte[] array2,
int length)
Checks if the beginnings of two byte arrays are equal.
|
static <T> int |
indexOf(T[] array,
T value)
Return first index of
value in array, or -1 if
not found. |
static boolean |
isEmpty(int[] array)
Checks if given array is null or has zero elements.
|
static boolean |
isEmpty(long[] array)
Checks if given array is null or has zero elements.
|
static <T> boolean |
isEmpty(T[] array)
Checks if given array is null or has zero elements.
|
static <T> boolean |
referenceEquals(ArrayList<T> a,
ArrayList<T> b)
Returns true if the two ArrayLists are equal with respect to the objects they contain.
|
static <T> ArrayList<T> |
remove(ArrayList<T> cur,
T val) |
static <T> T[] |
removeElement(Class<T> kind,
T[] array,
T element)
Removes value from given array if present, providing set-like behavior.
|
static long |
total(long[] array) |
public static boolean equals(byte[] array1,
byte[] array2,
int length)
array1 - the first byte arrayarray2 - the second byte arraylength - the number of bytes to checkpublic static <T> boolean isEmpty(T[] array)
public static boolean isEmpty(int[] array)
public static boolean isEmpty(long[] array)
public static <T> boolean contains(T[] array,
T value)
array - the array to check invalue - the value to check forpublic static <T> int indexOf(T[] array,
T value)
value in array, or -1 if
not found.public static <T> boolean containsAll(T[] array,
T[] check)
check items are contained in array.public static boolean contains(int[] array,
int value)
public static boolean contains(long[] array,
long value)
public static long total(long[] array)
public static <T> T[] appendElement(Class<T> kind, T[] array, T element)
public static <T> T[] aheadElement(Class<T> kind, T[] array, T element)
public static <T> T[] removeElement(Class<T> kind, T[] array, T element)
public static <T> boolean contains(ArrayList<T> cur, T val)
Copyright © 2020 com.github.braisdom. All rights reserved.