public final class Arrays extends Object
| Modifier and Type | Method and Description |
|---|---|
static <E> void |
addAll(Collection<E> collection,
E[]... arr)
Adds the contents of one or more arrays to a collection.
|
static <E> List<E> |
asList(E[]... arrs)
Returns a newly created random access list with the contents of the
provided arrays.
|
static <E> Set<E> |
asSet(E[] objs)
Returns a Set (specfically, a HashSet) with all the unique elements from
the given array of objects.
|
static boolean |
contains(Object[] arr,
Object obj)
Returns where an object is in a given array.
|
static void |
matrixCopy(Object[][] src,
Object[][] dest)
Copies a 2D array.
|
static void |
matrixFill(Object[][] matrix,
Object val)
Fills a 2D array with a value.
|
public static void matrixCopy(Object[][] src, Object[][] dest)
null.src - an array.dest - an array.public static void matrixFill(Object[][] matrix, Object val)
matrix is
null. Likewise, nothing happens to a null row.matrix - a 2D Object[] array.val - an Object value.public static boolean contains(Object[] arr, Object obj)
arr - the Object[] to search.obj - the Object to search for.true of obj is in arr,
false otherwise. Returns false if
arr is null.public static <E> Set<E> asSet(E[] objs)
objs - An array of objects.@SafeVarargs public static <E> void addAll(Collection<E> collection, E[]... arr)
collection - a Collection. Cannot be null.arr - zero or more E[].@SafeVarargs public static <E> List<E> asList(E[]... arrs)
E - any class.arrs - one or more E[].List.Copyright © 2012–2020 Emory University. All rights reserved.