Java Utililty Methods Iterable to List

List of utility methods to do Iterable to List

Description

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

Method

Listiterable2List(Iterable 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;
ListiterableAsList(Iterable iterable)
Creates a new List from a given Iterable
return iterable == null ? new ArrayList<E>() : iteratorAsList(iterable.iterator());
voiditerableToCollection(Iterable c, Collection list)
iterable To Collection
for (T element : c) {
    list.add(element);
voiditerableToCollection(Iterable c, Collection list)
iterable To Collection
for (T element : c) {
    list.add(element);
ListiterableToList(Iterable iterable)
iterable To List
return iterableToList(iterable, null);
ListiterableToList(Iterable input)
iterable To List
ArrayList<T> result = new ArrayList<>();
for (T item : input) {
    result.add(item);
return result;
ListiterableToList(Iterable 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();
...
StringiterableToSSV(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;
ListtoList(Iterable i)
to List
return toList(i, 10);
ListtoList(Iterable items)
Wraps the given items in a mutable list.
ArrayList<T> coll = new ArrayList<T>();
for (T item : items) {
    coll.add(item);
return coll;