Android Utililty Methods Array to List Convert

List of utility methods to do Array to List Convert

Description

The list of methods to do Array to List Convert are organized into topic(s).

Method

ListarrayToList(T[] array)
array To List
final ArrayList<T> list = new ArrayList<T>(array.length);
for (final T i : array)
    list.add(i);
return list;
ListasList(T... args)
as List
ArrayList<T> rv = new ArrayList<T>();
for (T a : args) {
    rv.add(a);
return rv;
ListasList(T... vals)
as List
ArrayList<T> result = new ArrayList<T>();
for (T i : vals)
    result.add(i);
return result;
ListasList(char[] array)
as List
List<Character> list = new ArrayList<Character>(array.length);
for (int i = 0; i != array.length; ++i)
    list.add(array[i]);
return list;
ListasList(int[] array)
as List
List<Integer> list = new ArrayList<Integer>(array.length);
for (int i = 0; i != array.length; ++i)
    list.add(array[i]);
return list;
ListasList(int[] intArray)
Converts an array of int into a List of Integer .
List<Integer> res = new ArrayList<Integer>(intArray.length);
for (int i : intArray) {
    res.add(i);
return res;
ListasList(long[] longArray)
Converts an array of long into a List of Long .
List<Long> res = new ArrayList<Long>(longArray.length);
for (long i : longArray) {
    res.add(i);
return res;
ArrayListconvertArrayToList(T[] array)
convert Array To List
ArrayList<T> ret = new ArrayList<T>(array.length);
for (T t : array) {
    ret.add(t);
return ret;
ListlistOf(final T... items)
list Of
return Collections.unmodifiableList(Arrays.asList(items));
ArrayListnewArrayList(E... elements)
new Array List
ArrayList<E> list = new ArrayList<E>(elements.length);
Collections.addAll(list, elements);
return list;