jdk/src/share/classes/java/util/Set.java
changeset 9503 588cf31d584a
parent 5506 202f599c92aa
child 14342 8435a30053c1
equal deleted inserted replaced
9502:de183d393b77 9503:588cf31d584a
   108      * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>.
   108      * <tt>(o==null&nbsp;?&nbsp;e==null&nbsp;:&nbsp;o.equals(e))</tt>.
   109      *
   109      *
   110      * @param o element whose presence in this set is to be tested
   110      * @param o element whose presence in this set is to be tested
   111      * @return <tt>true</tt> if this set contains the specified element
   111      * @return <tt>true</tt> if this set contains the specified element
   112      * @throws ClassCastException if the type of the specified element
   112      * @throws ClassCastException if the type of the specified element
   113      *         is incompatible with this set (optional)
   113      *         is incompatible with this set
       
   114      * (<a href="Collection.html#optional-restrictions">optional</a>)
   114      * @throws NullPointerException if the specified element is null and this
   115      * @throws NullPointerException if the specified element is null and this
   115      *         set does not permit null elements (optional)
   116      *         set does not permit null elements
       
   117      * (<a href="Collection.html#optional-restrictions">optional</a>)
   116      */
   118      */
   117     boolean contains(Object o);
   119     boolean contains(Object o);
   118 
   120 
   119     /**
   121     /**
   120      * Returns an iterator over the elements in this set.  The elements are
   122      * Returns an iterator over the elements in this set.  The elements are
   234      * call returns.)
   236      * call returns.)
   235      *
   237      *
   236      * @param o object to be removed from this set, if present
   238      * @param o object to be removed from this set, if present
   237      * @return <tt>true</tt> if this set contained the specified element
   239      * @return <tt>true</tt> if this set contained the specified element
   238      * @throws ClassCastException if the type of the specified element
   240      * @throws ClassCastException if the type of the specified element
   239      *         is incompatible with this set (optional)
   241      *         is incompatible with this set
       
   242      * (<a href="Collection.html#optional-restrictions">optional</a>)
   240      * @throws NullPointerException if the specified element is null and this
   243      * @throws NullPointerException if the specified element is null and this
   241      *         set does not permit null elements (optional)
   244      *         set does not permit null elements
       
   245      * (<a href="Collection.html#optional-restrictions">optional</a>)
   242      * @throws UnsupportedOperationException if the <tt>remove</tt> operation
   246      * @throws UnsupportedOperationException if the <tt>remove</tt> operation
   243      *         is not supported by this set
   247      *         is not supported by this set
   244      */
   248      */
   245     boolean remove(Object o);
   249     boolean remove(Object o);
   246 
   250 
   255      * @param  c collection to be checked for containment in this set
   259      * @param  c collection to be checked for containment in this set
   256      * @return <tt>true</tt> if this set contains all of the elements of the
   260      * @return <tt>true</tt> if this set contains all of the elements of the
   257      *         specified collection
   261      *         specified collection
   258      * @throws ClassCastException if the types of one or more elements
   262      * @throws ClassCastException if the types of one or more elements
   259      *         in the specified collection are incompatible with this
   263      *         in the specified collection are incompatible with this
   260      *         set (optional)
   264      *         set
       
   265      * (<a href="Collection.html#optional-restrictions">optional</a>)
   261      * @throws NullPointerException if the specified collection contains one
   266      * @throws NullPointerException if the specified collection contains one
   262      *         or more null elements and this set does not permit null
   267      *         or more null elements and this set does not permit null
   263      *         elements (optional), or if the specified collection is null
   268      *         elements
       
   269      * (<a href="Collection.html#optional-restrictions">optional</a>),
       
   270      *         or if the specified collection is null
   264      * @see    #contains(Object)
   271      * @see    #contains(Object)
   265      */
   272      */
   266     boolean containsAll(Collection<?> c);
   273     boolean containsAll(Collection<?> c);
   267 
   274 
   268     /**
   275     /**
   300      * @param  c collection containing elements to be retained in this set
   307      * @param  c collection containing elements to be retained in this set
   301      * @return <tt>true</tt> if this set changed as a result of the call
   308      * @return <tt>true</tt> if this set changed as a result of the call
   302      * @throws UnsupportedOperationException if the <tt>retainAll</tt> operation
   309      * @throws UnsupportedOperationException if the <tt>retainAll</tt> operation
   303      *         is not supported by this set
   310      *         is not supported by this set
   304      * @throws ClassCastException if the class of an element of this set
   311      * @throws ClassCastException if the class of an element of this set
   305      *         is incompatible with the specified collection (optional)
   312      *         is incompatible with the specified collection
       
   313      * (<a href="Collection.html#optional-restrictions">optional</a>)
   306      * @throws NullPointerException if this set contains a null element and the
   314      * @throws NullPointerException if this set contains a null element and the
   307      *         specified collection does not permit null elements (optional),
   315      *         specified collection does not permit null elements
       
   316      *         (<a href="Collection.html#optional-restrictions">optional</a>),
   308      *         or if the specified collection is null
   317      *         or if the specified collection is null
   309      * @see #remove(Object)
   318      * @see #remove(Object)
   310      */
   319      */
   311     boolean retainAll(Collection<?> c);
   320     boolean retainAll(Collection<?> c);
   312 
   321 
   320      * @param  c collection containing elements to be removed from this set
   329      * @param  c collection containing elements to be removed from this set
   321      * @return <tt>true</tt> if this set changed as a result of the call
   330      * @return <tt>true</tt> if this set changed as a result of the call
   322      * @throws UnsupportedOperationException if the <tt>removeAll</tt> operation
   331      * @throws UnsupportedOperationException if the <tt>removeAll</tt> operation
   323      *         is not supported by this set
   332      *         is not supported by this set
   324      * @throws ClassCastException if the class of an element of this set
   333      * @throws ClassCastException if the class of an element of this set
   325      *         is incompatible with the specified collection (optional)
   334      *         is incompatible with the specified collection
       
   335      * (<a href="Collection.html#optional-restrictions">optional</a>)
   326      * @throws NullPointerException if this set contains a null element and the
   336      * @throws NullPointerException if this set contains a null element and the
   327      *         specified collection does not permit null elements (optional),
   337      *         specified collection does not permit null elements
       
   338      *         (<a href="Collection.html#optional-restrictions">optional</a>),
   328      *         or if the specified collection is null
   339      *         or if the specified collection is null
   329      * @see #remove(Object)
   340      * @see #remove(Object)
   330      * @see #contains(Object)
   341      * @see #contains(Object)
   331      */
   342      */
   332     boolean removeAll(Collection<?> c);
   343     boolean removeAll(Collection<?> c);