Java Utililty Methods Iterator to List

List of utility methods to do Iterator to List

Description

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

Method

ListtoList(Iterator iterator)
Gets a list based on an iterator.
return toList(iterator, 10);
ListtoList(Iterator iterator)
to List
ArrayList<Object> ret = new ArrayList<Object>();
while (iterator.hasNext())
    ret.add(iterator.next());
return ret;
ListtoList(Iterator src)
Creates a List containing all the elements from an Iterator.
LinkedList<A> l = new LinkedList<A>();
addAll(l, src);
return l;
ListtoList(Iterator iterator)
Adds iterator remaining elements to a list.
List<E> eList = new ArrayList<>();
iterator.forEachRemaining(eList::add);
return eList;
ListtoList(Iterator it)
to List
List<T> l = new ArrayList<T>();
while (it.hasNext()) {
    l.add(it.next());
return l;
ListtoList(Iterator iter)
Materializes the results of a java.util.Iterator as a java.util.List .
List<T> list = new ArrayList<T>();
while (iter.hasNext()) {
    list.add(iter.next());
return list;