Java Iterator addAllToSet(Set set, Iterator it)

Here you can find the source of addAllToSet(Set set, Iterator it)

Description

add All To Set

License

Open Source License

Declaration

public static <T> void addAllToSet(Set<T> set, Iterator<? extends T> it) 

Method Source Code

//package com.java2s;
/**/*from ww w  .  j  a  v a2  s. c o m*/
 * This file is part of the Joana IFC project. It is developed at the
 * Programming Paradigms Group of the Karlsruhe Institute of Technology.
 *
 * For further details on licensing please read the information at
 * http://joana.ipd.kit.edu or contact the authors.
 */

import java.util.Iterator;

import java.util.Set;

public class Main {
    public static <T> void addAllToSet(Set<T> set, Iterator<? extends T> it) {
        while (it.hasNext()) {
            set.add(it.next());
        }
    }
}

Related

  1. addAll(Iterator source, U target)
  2. addAll(List target, Iterator source)
  3. addAll(Set s, Iterator i)
  4. addAllFromIterator( COLL dest, Iterator source)
  5. addAllToList(Iterator i)
  6. addTo(final Iterator iter, final C c)
  7. appendTo(final Iterator iter, final List list)
  8. areEqual(final Iterator a, final Iterator b)
  9. areEqual(final Iterator ittyA, final Iterator ittyB)