public class ArrayUtils
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
ArrayUtils.CompositeUnmodifiableArrayList<E> |
private static class |
ArrayUtils.UnmodifiableArrayList<E> |
Modifier | Constructor and Description |
---|---|
private |
ArrayUtils() |
Modifier and Type | Method and Description |
---|---|
static <E> java.util.List<E> |
toUnmodifiableCompositeList(E[] array1,
E[] array2)
Returns an unmodifiable
List containing the second array appended to the first one. |
static <E> java.util.List<E> |
toUnmodifiableList(E[] elements)
Returns an unmodifiable
List backed by the given array. |
public static <E> java.util.List<E> toUnmodifiableList(E[] elements)
List
backed by the given array. The method doesn't copy the
array, so the changes to the array will affect the List
as well.E
- class of the elements in the arrayelements
- - array to convertList
backed by the given arraypublic static <E> java.util.List<E> toUnmodifiableCompositeList(E[] array1, E[] array2)
List
containing the second array appended to the first one. The
method doesn't copy the arrays, so the changes to the arrays will affect the List
as
well.E
- class of the elements in the arrayarray1
- - the array to extendarray2
- - the array to add to the firstList
backed by the given arrays