Java Iterator fill(final Iterator iterator, final S collection)

Here you can find the source of fill(final Iterator iterator, final S collection)

Description

fill

License

Apache License

Declaration

public static final <S extends Collection<T>, T> S fill(final Iterator<T> iterator, final S collection) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.util.Collection;

import java.util.Iterator;

public class Main {
    public static final <S extends Collection<T>, T> S fill(final Iterator<T> iterator, final S collection) {
        while (iterator.hasNext()) {
            collection.add(iterator.next());
        }//  ww w.ja va 2s  .c  om
        return collection;
    }
}

Related

  1. createPathIterator(String path)
  2. createSkipIterator(Iterable source, int count)
  3. dump(Iterator it)
  4. endOfData(Iterator inputIter, Iterator resultIter)
  5. equalsIterator(Iterator it, Iterator it2)
  6. fillArray(Iterator ii, Object[] fillMe, boolean null_terminate)
  7. fillCollection(final Iterator iterator, final Collection collection)
  8. fillCollection(final Iterator iterator, final Collection collection)
  9. firstOrDefault(Iterator iterator)