diff options
author | Andrew John Hughes <gnu_andrew@member.fsf.org> | 2004-08-01 11:14:42 +0000 |
---|---|---|
committer | Michael Koch <mkoch@gcc.gnu.org> | 2004-08-01 11:14:42 +0000 |
commit | b828123e23c9a8fb42b98a54b34141fe4dace764 (patch) | |
tree | 3ae8e78c344eaaa79a9b787c8b0546d1c8fdb2c0 /libjava/java/util/List.java | |
parent | 5b5662eea779eb744d214bd46fc4e4fed67b8d33 (diff) | |
download | gcc-b828123e23c9a8fb42b98a54b34141fe4dace764.zip gcc-b828123e23c9a8fb42b98a54b34141fe4dace764.tar.gz gcc-b828123e23c9a8fb42b98a54b34141fe4dace764.tar.bz2 |
Collection.java, [...]: Added additional exceptions to documentation.
2004-08-01 Andrew John Hughes <gnu_andrew@member.fsf.org>
* 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
Diffstat (limited to 'libjava/java/util/List.java')
-rw-r--r-- | libjava/java/util/List.java | 44 |
1 files changed, 40 insertions, 4 deletions
diff --git a/libjava/java/util/List.java b/libjava/java/util/List.java index 22a6b83..0f7f409 100644 --- a/libjava/java/util/List.java +++ b/libjava/java/util/List.java @@ -97,6 +97,8 @@ public interface List extends Collection * type * @throws IllegalArgumentException if o cannot be added to this list for * some other reason + * @throws NullPointerException if o is null and this list doesn't support + * the addition of null values. */ void add(int index, Object o); @@ -113,6 +115,8 @@ public interface List extends Collection * type * @throws IllegalArgumentException if o cannot be added to this list for * some other reason + * @throws NullPointerException if o is null and this list doesn't support + * the addition of null values. */ boolean add(Object o); @@ -134,6 +138,8 @@ public interface List extends Collection * list due to its type * @throws IllegalArgumentException if some element of c cannot be added * to this list for some other reason + * @throws NullPointerException if some element of c is null and this list + * doesn't support the addition of null values. * @throws NullPointerException if the specified collection is null * @see #add(int, Object) */ @@ -155,6 +161,8 @@ public interface List extends Collection * @throws IllegalArgumentException if some element of c cannot be added * to this list for some other reason * @throws NullPointerException if the specified collection is null + * @throws NullPointerException if some element of c is null and this list + * doesn't support the addition of null values. * @see #add(Object) */ boolean addAll(Collection c); @@ -175,6 +183,10 @@ public interface List extends Collection * * @param o the element to look for * @return true if this list contains the element + * @throws ClassCastException if the type of o is not a valid type + * for this list. + * @throws NullPointerException if o is null and the list doesn't + * support null values. */ boolean contains(Object o); @@ -184,6 +196,10 @@ public interface List extends Collection * @param c the collection to test for * @return true if for every element o in c, contains(o) would return true * @throws NullPointerException if the collection is null + * @throws ClassCastException if the type of any element in c is not a valid + * type for this list. + * @throws NullPointerException if some element of c is null and this + * list does not support null values. * @see #contains(Object) */ boolean containsAll(Collection c); @@ -240,7 +256,11 @@ while (i.hasNext()) * * @param o the object to search for * @return the least integer n such that <code>o == null ? get(n) == null : - * o.equals(get(n))</code>, or -1 if there is no such index + * o.equals(get(n))</code>, or -1 if there is no such index. + * @throws ClassCastException if the type of o is not a valid + * type for this list. + * @throws NullPointerException if o is null and this + * list does not support null values. */ int indexOf(Object o); @@ -263,7 +283,11 @@ while (i.hasNext()) * list. * * @return the greatest integer n such that <code>o == null ? get(n) == null - * : o.equals(get(n))</code>, or -1 if there is no such index + * : o.equals(get(n))</code>, or -1 if there is no such index. + * @throws ClassCastException if the type of o is not a valid + * type for this list. + * @throws NullPointerException if o is null and this + * list does not support null values. */ int lastIndexOf(Object o); @@ -310,6 +334,10 @@ while (i.hasNext()) * the list contained at least one occurrence of o * @throws UnsupportedOperationException if this list does not support the * remove operation + * @throws ClassCastException if the type of o is not a valid + * type for this list. + * @throws NullPointerException if o is null and this + * list does not support removing null values. */ boolean remove(Object o); @@ -322,6 +350,10 @@ while (i.hasNext()) * @throws UnsupportedOperationException if this list does not support the * removeAll operation * @throws NullPointerException if the collection is null + * @throws ClassCastException if the type of any element in c is not a valid + * type for this list. + * @throws NullPointerException if some element of c is null and this + * list does not support removing null values. * @see #remove(Object) * @see #contains(Object) */ @@ -337,6 +369,10 @@ while (i.hasNext()) * @throws UnsupportedOperationException if this list does not support the * retainAll operation * @throws NullPointerException if the collection is null + * @throws ClassCastException if the type of any element in c is not a valid + * type for this list. + * @throws NullPointerException if some element of c is null and this + * list does not support retaining null values. * @see #remove(Object) * @see #contains(Object) */ @@ -355,6 +391,8 @@ while (i.hasNext()) * type * @throws IllegalArgumentException if o cannot be added to this list for * some other reason + * @throws NullPointerException if o is null and this + * list does not support null values. */ Object set(int index, Object o); @@ -381,8 +419,6 @@ while (i.hasNext()) * @return a List backed by a subsection of this list * @throws IndexOutOfBoundsException if fromIndex < 0 * || toIndex > size() || fromIndex > toIndex - * @throws IllegalArgumentException if fromIndex > toIndex (according to - * AbstractList). Don't you love Sun's inconsistent specifications? */ List subList(int fromIndex, int toIndex); |