ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/NavigableSet.java
(Generate patch)

Comparing jsr166/src/main/java/util/NavigableSet.java (file contents):
Revision 1.1 by dl, Tue Dec 28 12:14:07 2004 UTC vs.
Revision 1.4 by dl, Tue Mar 22 16:48:32 2005 UTC

# Line 21 | Line 21 | package java.util;
21   * additionally defines methods <tt>pollFirst</tt> and
22   * <t>pollLast</tt> that return and remove the lowest and highest key,
23   * if one exists, else returning <tt>null</tt>.
24 + * Methods <tt>navigableSubSet</tt>, <tt>navigableHeadSet</tt>, and
25 + * <tt>navigableTailSet</tt> differ from the similarly named
26 + * <tt>SortedSet</tt> methods only in that the returned sets
27 + * are guaranteed to obey the <tt>NavigableSet</tt> interface.
28   *
29   * <p> The return values of navigation methods may be ambiguous in
30   * implementations that permit <tt>null</tt> elements. However, even
# Line 44 | Line 48 | public interface NavigableSet<E> extends
48       * @throws ClassCastException if o cannot be compared with the elements
49       *            currently in the set.
50       * @throws NullPointerException if o is <tt>null</tt>
51 <     * and this set deas not permit <tt>null</tt> elements
51 >     * and this set does not permit <tt>null</tt> elements
52       */
53 <    public E ceiling(E o);
53 >    E ceiling(E o);
54  
55      /**
56       * Returns an element strictly less than the given element, or
# Line 58 | Line 62 | public interface NavigableSet<E> extends
62       * @throws ClassCastException if o cannot be compared with the elements
63       *            currently in the set.
64       * @throws NullPointerException if o is <tt>null</tt>
65 <     * and this set deas not permit <tt>null</tt> elements
65 >     * and this set does not permit <tt>null</tt> elements
66       */
67 <    public E lower(E o);
67 >    E lower(E o);
68  
69      /**
70       * Returns an element less than or equal to the given element, or
# Line 72 | Line 76 | public interface NavigableSet<E> extends
76       * @throws ClassCastException if o cannot be compared with the elements
77       *            currently in the set.
78       * @throws NullPointerException if o is <tt>null</tt>.
79 <     * and this set deas not permit <tt>null</tt> elements
79 >     * and this set does not permit <tt>null</tt> elements
80       */
81 <    public E floor(E o);
81 >    E floor(E o);
82  
83      /**
84       * Returns an element strictly greater than the given element, or
# Line 86 | Line 90 | public interface NavigableSet<E> extends
90       * @throws ClassCastException if o cannot be compared with the elements
91       *            currently in the set.
92       * @throws NullPointerException if o is <tt>null</tt>
93 <     * and this set deas not permit <tt>null</tt> elements
93 >     * and this set does not permit <tt>null</tt> elements
94       */
95 <    public E higher(E o);
95 >    E higher(E o);
96  
97      /**
98       * Retrieves and removes the first (lowest) element.
99       *
100       * @return the first element, or <tt>null</tt> if empty.
101       */
102 <    public E pollFirst();
102 >    E pollFirst();
103  
104      /**
105       * Retrieves and removes the last (highest) element.
106       *
107       * @return the last element, or <tt>null</tt> if empty.
108       */
109 <    public E pollLast();
109 >    E pollLast();
110  
111      /**
112       * Returns an iterator over the elements in this collection, in
# Line 113 | Line 117 | public interface NavigableSet<E> extends
117      Iterator<E> descendingIterator();
118  
119      /**
120 <     * Returns a view of the portion of this set whose elements range from
121 <     * <tt>fromElement</tt>, inclusive, to <tt>toElement</tt>, exclusive.  (If
122 <     * <tt>fromElement</tt> and <tt>toElement</tt> are equal, the returned
123 <     * sorted set is empty.)  The returned sorted set is backed by this set,
124 <     * so changes in the returned sorted set are reflected in this set, and
125 <     * vice-versa.
120 >     * Returns a view of the portion of this set whose elements range
121 >     * from <tt>fromElement</tt>, inclusive, to <tt>toElement</tt>,
122 >     * exclusive.  (If <tt>fromElement</tt> and <tt>toElement</tt> are
123 >     * equal, the returned navigable set is empty.)  The returned
124 >     * navigable set is backed by this set, so changes in the returned
125 >     * navigable set are reflected in this set, and vice-versa.
126 >     *
127       * @param fromElement low endpoint (inclusive) of the subSet.
128       * @param toElement high endpoint (exclusive) of the subSet.
129       * @return a view of the portion of this set whose elements range from
# Line 132 | Line 137 | public interface NavigableSet<E> extends
137       * greater than <tt>toElement</tt>.
138       * @throws NullPointerException if <tt>fromElement</tt> or
139       *         <tt>toElement</tt> is <tt>null</tt>
140 <     * and this set deas not permit <tt>null</tt> elements
140 >     * and this set does not permit <tt>null</tt> elements
141       */
142 <    public NavigableSet<E> subSet(E fromElement, E toElement);
142 >    NavigableSet<E> navigableSubSet(E fromElement, E toElement);
143  
144      /**
145 <     * Returns a view of the portion of this set whose elements are strictly
146 <     * less than <tt>toElement</tt>.  The returned sorted set is backed by
147 <     * this set, so changes in the returned sorted set are reflected in this
148 <     * set, and vice-versa.  
145 >     * Returns a view of the portion of this set whose elements are
146 >     * strictly less than <tt>toElement</tt>.  The returned navigable
147 >     * set is backed by this set, so changes in the returned navigable
148 >     * set are reflected in this set, and vice-versa.
149       * @param toElement high endpoint (exclusive) of the headSet.
150       * @return a view of the portion of this set whose elements are strictly
151       *         less than toElement.
# Line 148 | Line 153 | public interface NavigableSet<E> extends
153       *         with this set's comparator (or, if the set has no comparator,
154       *         if <tt>toElement</tt> does not implement <tt>Comparable</tt>).
155       * @throws NullPointerException if <tt>toElement</tt> is <tt>null</tt>
156 <     * and this set deas not permit <tt>null</tt> elements
156 >     * and this set does not permit <tt>null</tt> elements
157       */
158 <    public NavigableSet<E> headSet(E toElement);
158 >    NavigableSet<E> navigableHeadSet(E toElement);
159  
160      /**
161       * Returns a view of the portion of this set whose elements are
162       * greater than or equal to <tt>fromElement</tt>.  The returned
163 <     * sorted set is backed by this set, so changes in the returned
164 <     * sorted set are reflected in this set, and vice-versa.
163 >     * navigable set is backed by this set, so changes in the returned
164 >     * navigable set are reflected in this set, and vice-versa.
165       * @param fromElement low endpoint (inclusive) of the tailSet.
166       * @return a view of the portion of this set whose elements are
167       * greater than or equal to <tt>fromElement</tt>.
# Line 165 | Line 170 | public interface NavigableSet<E> extends
170       * comparator, if <tt>fromElement</tt> does not implement
171       * <tt>Comparable</tt>).
172       * @throws NullPointerException if <tt>fromElement</tt> is <tt>null</tt>
173 <     * and this set deas not permit <tt>null</tt> elements
173 >     * and this set does not permit <tt>null</tt> elements
174       */
175 <    public NavigableSet<E> tailSet(E fromElement);
175 >    NavigableSet<E> navigableTailSet(E fromElement);
176   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines