--- jsr166/src/main/java/util/TreeSet.java 2006/04/19 15:07:14 1.21 +++ jsr166/src/main/java/util/TreeSet.java 2006/04/21 03:24:07 1.23 @@ -75,10 +75,10 @@ package java.util; public class TreeSet extends AbstractSet implements NavigableSet, Cloneable, java.io.Serializable { - /** + /** * The backing map. */ - private transient NavigableMap m; + private transient NavigableMap m; // Dummy value to associate with an Object in the backing Map private static final Object PRESENT = new Object(); @@ -203,7 +203,7 @@ public class TreeSet extends Abstract * Returns {@code true} if this set contains the specified element. * More formally, returns {@code true} if and only if this set * contains an element {@code e} such that - * {@code (o==null ? e==null : o.equals(e))}. + * (o==null ? e==null : o.equals(e)). * * @param o object to be checked for containment in this set * @return {@code true} if this set contains the specified element @@ -221,7 +221,7 @@ public class TreeSet extends Abstract * Adds the specified element to this set if it is not already present. * More formally, adds the specified element {@code e} to this set if * the set contains no element {@code e2} such that - * {@code (e==null ? e2==null : e.equals(e2))}. + * (e==null ? e2==null : e.equals(e2)). * If this set already contains the element, the call leaves the set * unchanged and returns {@code false}. * @@ -241,7 +241,7 @@ public class TreeSet extends Abstract /** * Removes the specified element from this set if it is present. * More formally, removes an element {@code e} such that - * {@code (o==null ? e==null : o.equals(e))}, + * (o==null ? e==null : o.equals(e)), * if this set contains such an element. Returns {@code 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 @@ -303,10 +303,10 @@ public class TreeSet extends Abstract * @throws IllegalArgumentException {@inheritDoc} * @since 1.6 */ - public NavigableSet navigableSubSet(E fromElement, boolean fromInclusive, - E toElement, boolean toInclusive) { - return new TreeSet(m.navigableSubMap(fromElement, fromInclusive, - toElement, toInclusive)); + public NavigableSet subSet(E fromElement, boolean fromInclusive, + E toElement, boolean toInclusive) { + return new TreeSet(m.subMap(fromElement, fromInclusive, + toElement, toInclusive)); } /** @@ -317,8 +317,8 @@ public class TreeSet extends Abstract * @throws IllegalArgumentException {@inheritDoc} * @since 1.6 */ - public NavigableSet navigableHeadSet(E toElement, boolean inclusive) { - return new TreeSet(m.navigableHeadMap(toElement, inclusive)); + public NavigableSet headSet(E toElement, boolean inclusive) { + return new TreeSet(m.headMap(toElement, inclusive)); } /** @@ -329,8 +329,8 @@ public class TreeSet extends Abstract * @throws IllegalArgumentException {@inheritDoc} * @since 1.6 */ - public NavigableSet navigableTailSet(E fromElement, boolean inclusive) { - return new TreeSet(m.navigableTailMap(fromElement, inclusive)); + public NavigableSet tailSet(E fromElement, boolean inclusive) { + return new TreeSet(m.tailMap(fromElement, inclusive)); } /** @@ -341,7 +341,7 @@ public class TreeSet extends Abstract * @throws IllegalArgumentException {@inheritDoc} */ public SortedSet subSet(E fromElement, E toElement) { - return navigableSubSet(fromElement, true, toElement, false); + return subSet(fromElement, true, toElement, false); } /** @@ -352,7 +352,7 @@ public class TreeSet extends Abstract * @throws IllegalArgumentException {@inheritDoc} */ public SortedSet headSet(E toElement) { - return navigableHeadSet(toElement, false); + return headSet(toElement, false); } /** @@ -363,7 +363,7 @@ public class TreeSet extends Abstract * @throws IllegalArgumentException {@inheritDoc} */ public SortedSet tailSet(E fromElement) { - return navigableTailSet(fromElement, true); + return tailSet(fromElement, true); } public Comparator comparator() {