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/Collection.java | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'libjava/java/util/Collection.java') diff --git a/libjava/java/util/Collection.java b/libjava/java/util/Collection.java index 977c603..6ec9c4e 100644 --- a/libjava/java/util/Collection.java +++ b/libjava/java/util/Collection.java @@ -94,6 +94,8 @@ public interface Collection * support the add operation. * @throws ClassCastException if o cannot be added to this collection due * to its type. + * @throws NullPointerException if o is null and this collection doesn't + * support the addition of null values. * @throws IllegalArgumentException if o cannot be added to this * collection for some other reason. */ @@ -108,6 +110,9 @@ public interface Collection * support the addAll operation. * @throws ClassCastException if some element of c cannot be added to this * collection due to its type. + * @throws NullPointerException if some element of c is null and this + * collection does not support the addition of null values. + * @throws NullPointerException if c itself is null. * @throws IllegalArgumentException if some element of c cannot be added * to this collection for some other reason. */ @@ -129,6 +134,10 @@ public interface Collection * @param o the element to look for. * @return true if this collection contains at least one element e such that * o == null ? e == null : o.equals(e). + * @throws ClassCastException if the type of o is not a valid type for this + * collection. + * @throws NullPointerException if o is null and this collection doesn't + * support null values. */ boolean contains(Object o); @@ -137,6 +146,11 @@ public interface Collection * * @param c the collection to test for. * @return true if for every element o in c, contains(o) would return true. + * @throws ClassCastException if the type of any element in c is not a valid + * type for this collection. + * @throws NullPointerException if some element of c is null and this + * collection does not support null values. + * @throws NullPointerException if c itself is null. */ boolean containsAll(Collection c); @@ -198,6 +212,10 @@ public interface Collection * if the collection contained at least one occurrence of o. * @throws UnsupportedOperationException if this collection does not * support the remove operation. + * @throws ClassCastException if the type of o is not a valid type + * for this collection. + * @throws NullPointerException if o is null and the collection doesn't + * support null values. */ boolean remove(Object o); @@ -208,6 +226,11 @@ public interface Collection * @return true if this collection was modified as a result of this call. * @throws UnsupportedOperationException if this collection does not * support the removeAll operation. + * @throws ClassCastException if the type of any element in c is not a valid + * type for this collection. + * @throws NullPointerException if some element of c is null and this + * collection does not support removing null values. + * @throws NullPointerException if c itself is null. */ boolean removeAll(Collection c); @@ -218,6 +241,11 @@ public interface Collection * @return true if this collection was modified as a result of this call. * @throws UnsupportedOperationException if this collection does not * support the retainAll operation. + * @throws ClassCastException if the type of any element in c is not a valid + * type for this collection. + * @throws NullPointerException if some element of c is null and this + * collection does not support retaining null values. + * @throws NullPointerException if c itself is null. */ boolean retainAll(Collection c); -- cgit v1.1