From b828123e23c9a8fb42b98a54b34141fe4dace764 Mon Sep 17 00:00:00 2001 From: Andrew John Hughes Date: Sun, 1 Aug 2004 11:14:42 +0000 Subject: Collection.java, [...]: Added additional exceptions to documentation. 2004-08-01 Andrew John Hughes * java/util/Collection.java, java/util/List.java, java/util/Map.java, java/util/Set.java, java/util/SortedMap.java, java/util/SortedSet.java: Added additional exceptions to documentation. From-SVN: r85403 --- libjava/java/util/Set.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'libjava/java/util/Set.java') diff --git a/libjava/java/util/Set.java b/libjava/java/util/Set.java index 8a3290f..eb4df3e 100644 --- a/libjava/java/util/Set.java +++ b/libjava/java/util/Set.java @@ -118,6 +118,10 @@ public interface Set extends Collection * * @param o the object to look for * @return true if it is found in the set + * @throws ClassCastException if the type of o is not a valid type + * for this set. + * @throws NullPointerException if o is null and this set doesn't + * support null values. */ boolean contains(Object o); @@ -129,6 +133,10 @@ public interface Set extends Collection * @param c the collection to check membership in * @return true if all elements in this set are in c * @throws NullPointerException if c is null + * @throws ClassCastException if the type of any element in c is not + * a valid type for this set. + * @throws NullPointerException if some element of c is null and this + * set doesn't support null values. * @see #contains(Object) */ boolean containsAll(Collection c); @@ -148,6 +156,7 @@ public interface Set extends Collection * equals, this is the sum of the hashcode of all elements in the set. * * @return the sum of the hashcodes of all set elements + * @see #equals(Object) */ int hashCode(); @@ -174,6 +183,10 @@ public interface Set extends Collection * @param o the object to remove * @return true if the set changed (an object was removed) * @throws UnsupportedOperationException if this operation is not allowed + * @throws ClassCastException if the type of o is not a valid type + * for this set. + * @throws NullPointerException if o is null and this set doesn't allow + * the removal of a null value. */ boolean remove(Object o); @@ -186,6 +199,10 @@ public interface Set extends Collection * @return true if this set changed as a result * @throws UnsupportedOperationException if this operation is not allowed * @throws NullPointerException if c is null + * @throws ClassCastException if the type of any element in c is not + * a valid type for this set. + * @throws NullPointerException if some element of c is null and this + * set doesn't support removing null values. * @see #remove(Object) */ boolean removeAll(Collection c); @@ -199,6 +216,10 @@ public interface Set extends Collection * @return true if this set was modified * @throws UnsupportedOperationException if this operation is not allowed * @throws NullPointerException if c is null + * @throws ClassCastException if the type of any element in c is not + * a valid type for this set. + * @throws NullPointerException if some element of c is null and this + * set doesn't support retaining null values. * @see #remove(Object) */ boolean retainAll(Collection c); -- cgit v1.1