List of utility methods to do Iterator to List
List | toList(Iterator iterator) Gets a list based on an iterator. return toList(iterator, 10);
|
List> | toList(Iterator> iterator) to List ArrayList<Object> ret = new ArrayList<Object>(); while (iterator.hasNext()) ret.add(iterator.next()); return ret; |
List | toList(Iterator src) Creates a List containing all the elements from an Iterator. LinkedList<A> l = new LinkedList<A>(); addAll(l, src); return l; |
List | toList(Iterator Adds iterator remaining elements to a list. List<E> eList = new ArrayList<>(); iterator.forEachRemaining(eList::add); return eList; |
List | toList(Iterator to List List<T> l = new ArrayList<T>(); while (it.hasNext()) { l.add(it.next()); return l; |
List | toList(Iterator 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; |