Removes from this set all of its elements that are contained in the
specified collection (optional operation). If the specified
collection is also a set, this operation effectively modifies this
set so that its value is the <i>asymmetric set difference</i> of
the two sets.
<p>This implementation determines which is the smaller of this set
and the specified collection, by invoking the <tt>size</tt>
method on each. If this set has fewer elements, then the
implementation iterates over this set, checking each element
returned by the iterator in turn to see if it is contained in
the specified collection. If it is so contained, it is removed
from this set with the iterator's <tt>remove</tt> method. If
the specified collection has fewer elements, then the
implementation iterates over the specified collection, removing
from this set each element returned by the iterator, using this
set's <tt>remove</tt> method.
<p>Note that this implementation will throw an
<tt>UnsupportedOperationException</tt> if the iterator returned by the
<tt>iterator</tt> method does not implement the <tt>remove</tt> method.
@param c collection containing elements to be removed from this set
@return <tt>true</tt> if this set changed as a result of the call
@throws UnsupportedOperationException if the <tt>removeAll</tt> operation
is not supported by this set
@throws ClassCastException if the class of an element of this set
is incompatible with the specified collection
(<a href="Collection.html#optional-restrictions">optional</a>)
@throws NullPointerException if this set contains a null element and the
specified collection does not permit null elements
(<a href="Collection.html#optional-restrictions">optional</a>),
or if the specified collection is null
@see #remove(Object)
@see #contains(Object)
Removes from this set all of its elements that are contained in the specified collection (optional operation). If the specified collection is also a set, this operation effectively modifies this set so that its value is the <i>asymmetric set difference</i> of the two sets.
<p>This implementation determines which is the smaller of this set and the specified collection, by invoking the <tt>size</tt> method on each. If this set has fewer elements, then the implementation iterates over this set, checking each element returned by the iterator in turn to see if it is contained in the specified collection. If it is so contained, it is removed from this set with the iterator's <tt>remove</tt> method. If the specified collection has fewer elements, then the implementation iterates over the specified collection, removing from this set each element returned by the iterator, using this set's <tt>remove</tt> method.
<p>Note that this implementation will throw an <tt>UnsupportedOperationException</tt> if the iterator returned by the <tt>iterator</tt> method does not implement the <tt>remove</tt> method.
@param c collection containing elements to be removed from this set @return <tt>true</tt> if this set changed as a result of the call @throws UnsupportedOperationException if the <tt>removeAll</tt> operation is not supported by this set @throws ClassCastException if the class of an element of this set is incompatible with the specified collection (<a href="Collection.html#optional-restrictions">optional</a>) @throws NullPointerException if this set contains a null element and the specified collection does not permit null elements (<a href="Collection.html#optional-restrictions">optional</a>), or if the specified collection is null @see #remove(Object) @see #contains(Object)