public final class Arrays extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> T[] |
add(T... elements)
Just concatenates the given elements to the array.
|
static <T> T[] |
add(T[]... arrays)
Adds all the elements of the given arrays into a new array.
|
static <T> T[] |
add(T[] array,
T... elements)
Copies the given array and adds the given elements at the end of the new array.
|
static <T> T[] |
add(T[] array,
T element) |
static <T> T[] |
addAll(T[] a1,
T[] a2)
Deprecated.
|
static boolean |
isEmpty(boolean[] array) |
static boolean |
isEmpty(byte[] array) |
static boolean |
isEmpty(char[] array) |
static boolean |
isEmpty(Collection<?> array) |
static boolean |
isEmpty(double[] array) |
static boolean |
isEmpty(float[] array) |
static boolean |
isEmpty(int[] array) |
static boolean |
isEmpty(long[] array) |
static boolean |
isEmpty(short[] array) |
static <T> boolean |
isEmpty(T[] array)
Checks if an array is empty or null.
|
static boolean |
isNotEmpty(boolean[] array) |
static boolean |
isNotEmpty(byte[] array) |
static boolean |
isNotEmpty(char[] array) |
static boolean |
isNotEmpty(Collection<?> array) |
static boolean |
isNotEmpty(double[] array) |
static boolean |
isNotEmpty(float[] array) |
static boolean |
isNotEmpty(int[] array) |
static boolean |
isNotEmpty(long[] array) |
static boolean |
isNotEmpty(short[] array) |
static <T> boolean |
isNotEmpty(T[] array)
Checks if an array is NOT empty or null.
|
static int |
length(boolean[] array) |
static int |
length(byte[] array) |
static int |
length(char[] array) |
static int |
length(Collection<?> array) |
static int |
length(double[] array) |
static int |
length(float[] array) |
static int |
length(int[] array) |
static int |
length(long[] array) |
static int |
length(Map<?,?> map) |
static int |
length(short[] array) |
static <T> int |
length(T[] array) |
static boolean[] |
slice(boolean[] values,
int startIndexInclusive) |
static boolean[] |
slice(boolean[] values,
int startIndexInclusive,
int endIndexExclusive) |
static byte[] |
slice(byte[] values,
int startIndexInclusive) |
static byte[] |
slice(byte[] values,
int startIndexInclusive,
int endIndexExclusive) |
static char[] |
slice(char[] values,
int startIndexInclusive) |
static char[] |
slice(char[] values,
int startIndexInclusive,
int endIndexExclusive) |
static double[] |
slice(double[] values,
int startIndexInclusive) |
static double[] |
slice(double[] values,
int startIndexInclusive,
int endIndexExclusive) |
static float[] |
slice(float[] values,
int startIndexInclusive) |
static float[] |
slice(float[] values,
int startIndexInclusive,
int endIndexExclusive) |
static int[] |
slice(int[] values,
int startIndexInclusive) |
static int[] |
slice(int[] values,
int startIndexInclusive,
int endIndexExclusive) |
static long[] |
slice(long[] values,
int startIndexInclusive) |
static long[] |
slice(long[] values,
int startIndexInclusive,
int endIndexExclusive) |
static short[] |
slice(short[] values,
int startIndexInclusive) |
static short[] |
slice(short[] values,
int startIndexInclusive,
int endIndexExclusive) |
static <T> T[] |
slice(T[] values,
int startIndexInclusive) |
static <T> T[] |
slice(T[] values,
int startIndexInclusive,
int endIndexExclusive) |
public static <T> boolean isEmpty(T[] array)
array - the array to testpublic static boolean isEmpty(Collection<?> array)
public static boolean isEmpty(byte[] array)
public static boolean isEmpty(char[] array)
public static boolean isEmpty(short[] array)
public static boolean isEmpty(int[] array)
public static boolean isEmpty(long[] array)
public static boolean isEmpty(float[] array)
public static boolean isEmpty(double[] array)
public static boolean isEmpty(boolean[] array)
public static <T> boolean isNotEmpty(T[] array)
array - the array to testpublic static boolean isNotEmpty(Collection<?> array)
public static boolean isNotEmpty(byte[] array)
public static boolean isNotEmpty(char[] array)
public static boolean isNotEmpty(short[] array)
public static boolean isNotEmpty(int[] array)
public static boolean isNotEmpty(long[] array)
public static boolean isNotEmpty(float[] array)
public static boolean isNotEmpty(double[] array)
public static boolean isNotEmpty(boolean[] array)
public static <T> int length(T[] array)
public static int length(Collection<?> array)
public static int length(Map<?,?> map)
public static int length(byte[] array)
public static int length(char[] array)
public static int length(short[] array)
public static int length(int[] array)
public static int length(long[] array)
public static int length(float[] array)
public static int length(double[] array)
public static int length(boolean[] array)
public static <T> T[] add(T... elements)
public static <T> T[] add(T[] array,
T element)
public static <T> T[] add(T[] array,
T... elements)
Copies the given array and adds the given elements at the end of the new array.
The new array contains the same elements of the input array plus the given elements in the last position. The component type of the new array is the same as that of the input array.
If the input array is null, a new one element array is returned whose component type is the same as
the element, unless the element itself is null, in which case the return type is Object[]
Arrays.add(null, null) = [null] Arrays.add(null, "a") = ["a"] Arrays.add(["a"], null) = ["a", null] Arrays.add(["a"], "b") = ["a", "b"] Arrays.add(["a", "b"], "c") = ["a", "b", "c"]
array - the array to "add" the element to, may be nullelements - the objects to addpublic static <T> T[] add(T[]... arrays)
Adds all the elements of the given arrays into a new array.
The new array contains all of the element of arrays. When an array is returned, it is always a new
array.
Arrays.add(null, null) = null Arrays.add(array1, null) = cloned copy of array1 Arrays.add(null, array2) = cloned copy of array2 Arrays.add([], []) = [] Arrays.add([null], [null]) = [null, null] Arrays.add(["a", "b", "c"], ["1", "2", "3"]) = ["a", "b", "c", "1", "2", "3"]
arrays - the arrays whose elements are added to the new array, may be nullnull if both arrays are null. The type of the new array is the
same type of the arrays.@Deprecated public static <T> T[] addAll(T[] a1, T[] a2)
public static <T> T[] slice(T[] values,
int startIndexInclusive)
public static byte[] slice(byte[] values,
int startIndexInclusive)
public static char[] slice(char[] values,
int startIndexInclusive)
public static short[] slice(short[] values,
int startIndexInclusive)
public static int[] slice(int[] values,
int startIndexInclusive)
public static long[] slice(long[] values,
int startIndexInclusive)
public static float[] slice(float[] values,
int startIndexInclusive)
public static double[] slice(double[] values,
int startIndexInclusive)
public static boolean[] slice(boolean[] values,
int startIndexInclusive)
public static <T> T[] slice(T[] values,
int startIndexInclusive,
int endIndexExclusive)
public static byte[] slice(byte[] values,
int startIndexInclusive,
int endIndexExclusive)
public static char[] slice(char[] values,
int startIndexInclusive,
int endIndexExclusive)
public static short[] slice(short[] values,
int startIndexInclusive,
int endIndexExclusive)
public static int[] slice(int[] values,
int startIndexInclusive,
int endIndexExclusive)
public static long[] slice(long[] values,
int startIndexInclusive,
int endIndexExclusive)
public static float[] slice(float[] values,
int startIndexInclusive,
int endIndexExclusive)
public static double[] slice(double[] values,
int startIndexInclusive,
int endIndexExclusive)
public static boolean[] slice(boolean[] values,
int startIndexInclusive,
int endIndexExclusive)
Copyright © 2004–2019 OpenL Tablets. All rights reserved.