Adds all the objects from another set to this set - union.
@param set The other set.
164313
void addAll(Hashset set) {
    for (Enumeration e = set.table.keys(); e.hasMoreElements();)
      add(e.nextElement());
  }

  /**
   * Removes all the objects from this set.
   */
  void clear() {
    table.clear();
  }

  /**
   * Get an enumeration will all the objects from this set.
   * @return an enumeration with all the objects from this set.
   */
  Enumeration members() {
    return table.keys();
  }
}
946987
public static ArrayList<String> toList( Set<String> set )
	{
		int n = set.size();
		ArrayList<String> list = new ArrayList<String>( n );
		for (String string : set)
		{
			list.add(string);
		}
		return list;
	}
1126846
public void addAll(Map<K, V> m) {
    if (m instanceof CollectionValuedMap<?, ?>) {
      throw new UnsupportedOperationException();
    }
    for (Map.Entry<K, V> e : m.entrySet()) {
      add(e.getKey(), e.getValue());
    }
  }
1213970
public Set<SortedSet<T>> allSupersets(final SortedSet<T> set) {
        final Set<SortedSet<T>> supersets = new LinkedHashSet<>();
        allSupersets(set, this.rootNodes, supersets);
        return supersets;
    }
1009048
def _combine_sets(self, sets, final_set):
        
        self.cls.get_connection().sinterstore(final_set, list(sets))
        return final_set
461230
@VisibleForTesting
  public FeatureSet with(Set<Feature> newFeatures) {
    return new FeatureSet(union(features, newFeatures));
  }
1214436
public void union(final HLL other) {
        // TODO: verify HLLs are compatible
        final HLLType otherType = other.getType();

        if(type.equals(otherType)) {
            homogeneousUnion(other);
            return;
        } else {
            heterogenousUnion(other);
            return;
        }
    }
1065653
Set<E> union(final SmallSet<E> s) {
        if ((s.e1 == e1 && s.e2 == e2) || (s.e1 == e2 && s.e2 == e1)) {
            return this; // if the two sets are equal, return this
        }
        if (s.e1 == null) {
            return this; // if s is empty, return this
        }
        if (e1 == null) {
            return s; // if this is empty, return s
        }
        if (s.e2 == null) { // s contains exactly one element
            if (e2 == null) {
                return new SmallSet<E>(e1, s.e1); // necessarily e1 != s.e1
            } else if (s.e1 == e1 || s.e1 == e2) { // s is included in this
                return this;
            }
        }
        if (e2 == null) { // this contains exactly one element
            // if (s.e2 == null) { // cannot happen
            // return new SmallSet(e1, s.e1); // necessarily e1 != s.e1
            // } else
            if (e1 == s.e1 || e1 == s.e2) { // this in included in s
                return s;
            }
        }
        // here we know that there are at least 3 distinct elements
        HashSet<E> r = new HashSet<E>(4);
        r.add(e1);
        if (e2 != null) {
            r.add(e2);
        }
        r.add(s.e1);
        if (s.e2 != null) {
            r.add(s.e2);
        }
        return r;
    }
691954
public static final <S, E> Functional<S> functionalSet(Set<E> set) {
		return new FunctionalSet<S, E>(set);
	}
124955
def union_update(self, other):
        
        if not isinstance(other, Set):
            raise ValueError('other must be a Set instance')
        if self is other:
            return
        for item in other.items:
            self.add(item)
260936
public void retainAll(IntBitSet set) {
        int i;

        if (set.data.length > data.length) {
            resize(set.data.length);
        }
        for (i = 0; i < set.data.length; i++) {
            data[i] &= set.data[i];
        }
        for ( ; i < data.length; i++) {
            data[i] = 0;
        }
    }
890752
public void
addRRset(RRset rrset) {
	Name name = rrset.getName();
	addRRset(name, rrset);
}
749680
public static <T> Set<T> cast(Set<?> set) {
    return set == null ? null : new CastingSet<T>(set);
  }
1101456
public static <E> Set<E> difference(Set<E> first, Set<E> second) {
        if (first == null || first.size() == 0) {
            return new HashSet<>();
        }

        if (second == null || second.size() == 0) {
            return first;
        }

        Set<E> difference = new HashSet<>(first);
        difference.removeAll(second);
        return difference;
    }
1051360
public static <E> Set<E> intersection(Set<E> s1, Set<E> s2) {
    Set<E> s = new HashSet<E>();
    s.addAll(s1);
    s.retainAll(s2);
    return s;
  }
1311255
public static <T> Set<T> immutableSetCopy(Set<T> set) {
      if (set == null) return null;
      if (set.isEmpty()) return Collections.emptySet();
      if (set.size() == 1) return Collections.singleton(set.iterator().next());
      Set<? extends T> copy = ObjectDuplicator.duplicateSet(set);
      if (copy == null)
         // Set uses Collection copy-ctor
         copy = attemptCopyConstructor(set, Collection.class);
      if (copy == null)
         copy = new HashSet<>(set);

      return new ImmutableSetWrapper<>(copy);
   }
1203575
function setadd(set, element) {
  if (set.has(element)) return false;
  set.add(element);
  return true;
}