示例#1
0
文件: HashSet.java 项目: troore/scale
 public HashSet<T> union(HashSet<T> u) {
   HashSet<T> n = new HashSet<T>(this);
   Iterator<T> e = u.iterator();
   while (e.hasNext()) n.add(e.next());
   return n;
 }
示例#2
0
文件: HashSet.java 项目: troore/scale
 /**
  * Add the elements of another HashSet to this HashSet.
  *
  * @param hs the HashSet from which the new elements are obtained
  */
 public void add(HashSet<T> hs) {
   Iterator<T> e = hs.iterator();
   while (e.hasNext()) this.add(e.next());
 }