Java Set Copy copySet(Set src, Set dest)

Here you can find the source of copySet(Set src, Set dest)

Description

copy Set

License

Apache License

Declaration

public static <E> void copySet(Set<E> src, Set<E> dest) 

Method Source Code

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

import java.util.Iterator;

import java.util.Set;

public class Main {

    public static <E> void copySet(Set<E> src, Set<E> dest) {
        for (Iterator<E> it = src.iterator(); it.hasNext();) {
            dest.add(it.next());//  w  ww  .j  a v a2s.  co  m
        }
    }
}

Related

  1. copy(Set source, Set target)
  2. copy(Set data)
  3. copyFeatureSet(Set o)
  4. copyToSet(Iterable elements)