public final class ArrayUtils extends Object
Modifier | Constructor and Description |
---|---|
private |
ArrayUtils() |
Modifier and Type | Method and Description |
---|---|
static String |
arrayToString(Object[] a,
String separator)
Allows to print arrays in a better fashion than a pointer.
|
static <T> List<T> |
cloneList(List<T> toClone)
This function allows to clone an existing list and returns the new List.
|
static <T> boolean |
contains(T[] list,
T element)
This method checks if an array contains an element.
|
static <T> List<T> |
differences(List<T> a,
List<T> b)
Given two lists a and b, this function returns a new list containing all
the elements of a not present in b and all the elements of b not present
in a.
|
static byte[] |
toByteArray(double value)
Converts a double into a byte array.
|
public static <T> List<T> cloneList(List<T> toClone)
T
- the generic type of the list to be cloned (same as the
resulting)toClone
- the list to clonepublic static <T> List<T> differences(List<T> a, List<T> b)
T
- the generic type of the listsa
- the first listb
- the second listpublic static String arrayToString(Object[] a, String separator)
a
- the array to printseparator
- the symbols to use to separate array elementspublic static <T> boolean contains(T[] list, T element)
T
- the generic type of the arraylist
- the array to checkelement
- the element to compare the array elements topublic static byte[] toByteArray(double value)
value
- the double to convert