List of utility methods to do Iterable to List
List | iterable2List(Iterable iterable List if (iterable instanceof List) { return (List<E>) iterable; ArrayList<E> list = new ArrayList<E>(); if (iterable != null) { for (E e : iterable) { list.add(e); return list; |
List | iterableAsList(Iterable Creates a new List from a given Iterable return iterable == null ? new ArrayList<E>() : iteratorAsList(iterable.iterator()); |
void | iterableToCollection(Iterable extends T> c, Collection iterable To Collection for (T element : c) {
list.add(element);
|
void | iterableToCollection(Iterable extends T> c, Collection iterable To Collection for (T element : c) {
list.add(element);
|
List | iterableToList(Iterable iterable To List return iterableToList(iterable, null);
|
List | iterableToList(Iterable iterable To List ArrayList<T> result = new ArrayList<>(); for (T item : input) { result.add(item); return result; |
List | iterableToList(Iterable Converts an iterable into a list. List<T> list = null; if (iterable instanceof List) { list = (List<T>) iterable; } else if (iterable instanceof Collection) { list = new ArrayList<T>((Collection<T>) iterable); } else { list = new ArrayList<T>(); Iterator<T> iterator = iterable.iterator(); ... |
String | iterableToSSV(Iterable list, String sep) iterable To SSV String ret = ""; for (Iterator it = list.iterator(); it.hasNext();) { ret += it.next().toString(); if (it.hasNext()) ret += sep; return ret; |
List | toList(Iterable extends E> i) to List return toList(i, 10);
|
List | toList(Iterable extends T> items) Wraps the given items in a mutable list. ArrayList<T> coll = new ArrayList<T>(); for (T item : items) { coll.add(item); return coll; |