public class Arrs extends Object
| 构造器和说明 |
|---|
Arrs() |
| 限定符和类型 | 方法和说明 |
|---|---|
static <E> E[] |
createArray(Class<E> componentType,
int length)
Create an array with the specified length
|
static <E> E[] |
createArray(Class<E> componentType,
int length,
E initValue)
Create an array with the specified length and every element's value is the specified initValue
|
static <E> E[] |
createArray(Class<E> componentType,
int length,
Supplier<Integer,E> initSupplier)
Create an array with the specified length and every element's value is supplied by the specified initSupplier
|
static boolean |
deepEquals(Object[] a1,
Object[] a2) |
static boolean |
deepEquals(Object e1,
Object e2) |
static int |
getLength(Object object)
get the length if argument is an array, else -1
|
static <E> void |
initArray(E[] array,
E initValue) |
static <E> void |
initArray(E[] array,
Supplier<Integer,E> initSupplier) |
static boolean |
isArray(Object o)
judge whether an object is an Array
|
static Integer[] |
range(int end)
It is similar to Python's range(start, end, step)
[start, end)
|
static Integer[] |
range(int start,
int end)
It is similar to Python's range(start, end, step)
[start, end)
|
static Integer[] |
range(int start,
int end,
int step)
It is similar to Python's range(start, end, step)
[start, end)
|
static <E> E[] |
wrapAsArray(E o)
Wrap any object using new Object[]{object};
|
public static int getLength(Object object)
object - any objectpublic static <E> E[] wrapAsArray(@Nullable E o)
public static <E> E[] createArray(@Nullable Class<E> componentType, int length)
public static <E> E[] createArray(@Nullable Class<E> componentType, int length, @Nullable E initValue)
public static <E> E[] createArray(@Nullable Class<E> componentType, int length, @NonNull Supplier<Integer,E> initSupplier)
public static <E> void initArray(@NonNull E[] array, @NonNull Supplier<Integer,E> initSupplier)
public static Integer[] range(int end)
range(int, int, int)public static Integer[] range(int start, int end)
range(int, int, int)public static Integer[] range(int start, int end, int step)
Copyright © 2019. All rights reserved.