Java Iterator fillCollection(final Iterator iterator, final Collection collection)

Here you can find the source of fillCollection(final Iterator iterator, final Collection collection)

Description

fill Collection

License

Open Source License

Declaration

public static <T> void fillCollection(final Iterator<T> iterator, final Collection<T> collection) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.Collection;
import java.util.Iterator;

public class Main {
    public static <T> void fillCollection(final Iterator<T> iterator, final Collection<T> collection) {
        while (iterator.hasNext()) {
            collection.add(iterator.next());
        }//from   www . ja  va  2  s .c om
    }
}

Related

  1. dump(Iterator it)
  2. endOfData(Iterator inputIter, Iterator resultIter)
  3. equalsIterator(Iterator it, Iterator it2)
  4. fill(final Iterator iterator, final S collection)
  5. fillArray(Iterator ii, Object[] fillMe, boolean null_terminate)
  6. fillCollection(final Iterator iterator, final Collection collection)
  7. firstOrDefault(Iterator iterator)
  8. fmtSeq(Iterator it, String divider)
  9. fromIterator(Iterator iterator)