/// <summary> /// Performs a "minus" of set <c>b</c> from set <c>a</c>. This returns a set of all /// the elements in set <c>a</c>, removing the elements that are also in set <c>b</c>. /// The original sets are not modified during this operation. The result set is a <c>Clone()</c> /// of this <c>Set</c> containing the elements from the operation. /// </summary> /// <param name="a">A set of elements.</param> /// <returns>A set containing the elements from this set with the elements in <c>a</c> removed.</returns> public Set Minus(Set a) { Set resultSet = (Set)this.Clone(); if (a != null) { resultSet.RemoveAll(a); } return(resultSet); }
/// <summary> /// Remove all the specified elements from this set, if they exist in this set. /// </summary> /// <param name="c">A collection of elements to remove.</param> /// <returns><c>true</c> if the set was modified as a result of this operation.</returns> public sealed override bool RemoveAll(ICollection c) { Set temp; lock (c.SyncRoot) { temp = new HybridSet(c); } lock (_syncRoot) { return(_basisSet.RemoveAll(temp)); } }