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.15 by dl, Wed Apr 19 15:07:14 2006 UTC vs.
Revision 1.22 by jsr166, Fri Apr 21 23:11:14 2006 UTC

# Line 8 | Line 8 | package java.util;
8  
9   /**
10   * A {@link SortedSet} extended with navigation methods reporting
11 < * closest matches for given search targets. Methods <tt>lower},
11 > * closest matches for given search targets. Methods {@code lower},
12   * {@code floor}, {@code ceiling}, and {@code higher} return elements
13   * respectively less than, less than or equal, greater than or equal,
14   * and greater than a given element, returning {@code null} if there
# Line 20 | Line 20 | package java.util;
20   * descending ones.  This interface additionally defines methods
21   * {@code pollFirst} and {@code pollLast} that return and remove the
22   * lowest and highest element, if one exists, else returning {@code
23 < * null}.  Methods {@code navigableSubSet}, {@code navigableHeadSet},
24 < * and {@code navigableTailSet} differ from the similarly named {@code
23 > * null}.  Methods {@code subSet}, {@code headSet},
24 > * and {@code tailSet} differ from the like-named {@code
25   * SortedSet} methods in accepting additional arguments describing
26   * whether lower and upper bounds are inclusive versus exclusive.
27   * Subsets of any {@code NavigableSet} must implement the {@code
# Line 129 | Line 129 | public interface NavigableSet<E> extends
129       * set in descending order.  The descending set is backed by this set, so
130       * changes to the set are reflected in the descending set, and vice-versa.
131       * If either set is modified while an iteration over the other set is in
132 <     * in progress (except through the iterator's own {@code remove} operation),
132 >     * progress (except through the iterator's own {@code remove} operation),
133       * the results of the iteration are undefined.
134       *
135 <     * @return a navigable set view of the mappings contained in this set,
136 <     *     sorted in descending order
135 >     * @return a navigable set view of the elements contained in this set,
136 >     *         sorted in descending order
137       */
138      NavigableSet<E> descendingSet();
139  
140      /**
141       * Returns an iterator over the elements in this set, in descending order.
142 <     * Equivalent in effect to <tt>descendingSet().iterator()</tt>.
142 >     * Equivalent in effect to {@code descendingSet().iterator()}.
143       *
144       * @return an iterator over the elements in this set, in descending order
145       */
# Line 158 | Line 158 | public interface NavigableSet<E> extends
158       * on an attempt to insert an element outside its range.
159       *
160       * @param fromElement low endpoint of the returned set
161 <     * @param fromInclusive true if the low endpoint ({@code fromElement}) is
162 <     *        to be included in the the returned view
161 >     * @param fromInclusive {@code true} if the low endpoint
162 >     *        is to be included in the returned view
163       * @param toElement high endpoint of the returned set
164 <     * @param toInclusive true if the high endpoint ({@code toElement}) is
165 <     *        to be included in the the returned view
164 >     * @param toInclusive {@code true} if the high endpoint
165 >     *        is to be included in the returned view
166       * @return a view of the portion of this set whose elements range from
167       *         {@code fromElement}, inclusive, to {@code toElement}, exclusive
168       * @throws ClassCastException if {@code fromElement} and
# Line 180 | Line 180 | public interface NavigableSet<E> extends
180       *         has a restricted range, and {@code fromElement} or
181       *         {@code toElement} lies outside the bounds of the range.
182       */
183 <    NavigableSet<E> navigableSubSet(E fromElement, boolean fromInclusive,
184 <                                    E toElement,   boolean toInclusive);
183 >    NavigableSet<E> subSet(E fromElement, boolean fromInclusive,
184 >                           E toElement,   boolean toInclusive);
185  
186      /**
187       * Returns a view of the portion of this set whose elements are less than
# Line 194 | Line 194 | public interface NavigableSet<E> extends
194       * on an attempt to insert an element outside its range.
195       *
196       * @param toElement high endpoint of the returned set
197 <     * @param inclusive true if the high endpoint ({@code toElement}) is
198 <     *        to be included in the the returned view
197 >     * @param inclusive {@code true} if the high endpoint
198 >     *        is to be included in the returned view
199       * @return a view of the portion of this set whose elements are less than
200       *         (or equal to, if {@code inclusive} is true) {@code toElement}
201       * @throws ClassCastException if {@code toElement} is not compatible
# Line 210 | Line 210 | public interface NavigableSet<E> extends
210       *         restricted range, and {@code toElement} lies outside the
211       *         bounds of the range
212       */
213 <    NavigableSet<E> navigableHeadSet(E toElement, boolean inclusive);
213 >    NavigableSet<E> headSet(E toElement, boolean inclusive);
214  
215      /**
216       * Returns a view of the portion of this set whose elements are greater
# Line 223 | Line 223 | public interface NavigableSet<E> extends
223       * on an attempt to insert an element outside its range.
224       *
225       * @param fromElement low endpoint of the returned set
226 <     * @param inclusive true if the low endpoint ({@code fromElement}) is
227 <     *        to be included in the the returned view
226 >     * @param inclusive {@code true} if the low endpoint
227 >     *        is to be included in the returned view
228       * @return a view of the portion of this set whose elements are greater
229       *         than or equal to {@code fromElement}
230       * @throws ClassCastException if {@code fromElement} is not compatible
# Line 239 | Line 239 | public interface NavigableSet<E> extends
239       *         restricted range, and {@code fromElement} lies outside the
240       *         bounds of the range
241       */
242 <    NavigableSet<E> navigableTailSet(E fromElement, boolean inclusive);
242 >    NavigableSet<E> tailSet(E fromElement, boolean inclusive);
243 >
244 >    /**
245 >     * Equivalent to {@code subSet(fromElement, true, toElement, false)}
246 >     * but with a return type conforming to the {@code SortedSet} interface.
247 >     *
248 >     * <p>{@inheritDoc}
249 >     *
250 >     * @throws ClassCastException       {@inheritDoc}
251 >     * @throws NullPointerException     {@inheritDoc}
252 >     * @throws IllegalArgumentException {@inheritDoc}
253 >     */
254 >    SortedSet<E> subSet(E fromElement, E toElement);
255 >
256 >    /**
257 >     * Equivalent to {@code headSet(toElement, false)}
258 >     * but with a return type conforming to the {@code SortedSet} interface.
259 >     *
260 >     * <p>{@inheritDoc}
261 >     *
262 >     * @throws ClassCastException       {@inheritDoc}
263 >     * @throws NullPointerException     {@inheritDoc}
264 >     * @throws IllegalArgumentException {@inheritDoc}
265 >     */
266 >    SortedSet<E> headSet(E toElement);
267 >
268 >    /**
269 >     * Equivalent to {@code tailSet(fromElement, true)}
270 >     * but with a return type conforming to the {@code SortedSet} interface.
271 >     *
272 >     * <p>{@inheritDoc}
273 >     *
274 >     * @throws ClassCastException       {@inheritDoc}
275 >     * @throws NullPointerException     {@inheritDoc}
276 >     * @throws IllegalArgumentException {@inheritDoc}
277 >     */
278 >    SortedSet<E> tailSet(E fromElement);
279   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines