--- jsr166/src/main/java/util/TreeSet.java 2005/05/19 07:47:49 1.15 +++ jsr166/src/main/java/util/TreeSet.java 2005/06/19 23:01:12 1.16 @@ -6,6 +6,7 @@ */ package java.util; +import java.util.*; // for javadoc (till 6280605 is fixed) /** * A {@link NavigableSet} implementation based on a {@link TreeMap}. @@ -191,8 +192,11 @@ public class TreeSet /** * Returns true if this set contains the specified element. + * More formally, returns true if and only if this set + * contains an element e such that + * (o==null ? e==null : o.equals(e)). * - * @param o the object to be checked for containment in this set + * @param o object to be checked for containment in this set * @return true if this set contains the specified element * @throws ClassCastException if the specified object cannot be compared * with the elements currently in the set @@ -206,12 +210,17 @@ public class TreeSet /** * Adds the specified element to this set if it is not already present. + * More formally, adds the specified element e to this set if + * the set contains no element e2 such that + * (e==null ? e2==null : e.equals(e2)). + * If this set already contains the element, the call leaves the set + * unchanged and returns false. * * @param e element to be added to this set - * @return true if the set did not already contain the specified + * @return true if this set did not already contain the specified * element * @throws ClassCastException if the specified object cannot be compared - * with the elements currently in the set + * with the elements currently in this set * @throws NullPointerException if the specified element is null * and this set uses natural ordering, or its comparator * does not permit null elements @@ -222,11 +231,17 @@ public class TreeSet /** * Removes the specified element from this set if it is present. + * More formally, removes an element e such that + * (o==null ? e==null : o.equals(e)), + * if this set contains such an element. Returns true if + * this set contained the element (or equivalently, if this set + * changed as a result of the call). (This set will not contain the + * element once the call returns.) * * @param o object to be removed from this set, if present - * @return true if the set contained the specified element + * @return true if this set contained the specified element * @throws ClassCastException if the specified object cannot be compared - * with the elements currently in the set + * with the elements currently in this set * @throws NullPointerException if the specified element is null * and this set uses natural ordering, or its comparator * does not permit null elements