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.2 by dl, Tue Mar 8 12:27:06 2005 UTC vs.
Revision 1.5 by jsr166, Mon May 2 08:35:49 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 38 | Line 42 | public interface NavigableSet<E> extends
42       * Returns an element greater than or equal to the given element, or
43       * <tt>null</tt> if there is no such element.
44       *
45 <     * @param o the value to match
45 >     * @param e the value to match
46       * @return an element greater than or equal to given element, or
47       * <tt>null</tt> if there is no such element.
48 <     * @throws ClassCastException if o cannot be compared with the elements
48 >     * @throws ClassCastException if e cannot be compared with the elements
49       *            currently in the set.
50 <     * @throws NullPointerException if o is <tt>null</tt>
50 >     * @throws NullPointerException if e is <tt>null</tt>
51       * and this set does not permit <tt>null</tt> elements
52       */
53 <    public E ceiling(E o);
53 >    E ceiling(E e);
54  
55      /**
56       * Returns an element strictly less than the given element, or
57       * <tt>null</tt> if there is no such element.
58       *
59 <     * @param o the value to match
59 >     * @param e the value to match
60       * @return the greatest element less than the given element, or
61       * <tt>null</tt> if there is no such element.
62 <     * @throws ClassCastException if o cannot be compared with the elements
62 >     * @throws ClassCastException if e cannot be compared with the elements
63       *            currently in the set.
64 <     * @throws NullPointerException if o is <tt>null</tt>
64 >     * @throws NullPointerException if e is <tt>null</tt>
65       * and this set does not permit <tt>null</tt> elements
66       */
67 <    public E lower(E o);
67 >    E lower(E e);
68  
69      /**
70       * Returns an element less than or equal to the given element, or
71       * <tt>null</tt> if there is no such element.
72       *
73 <     * @param o the value to match
73 >     * @param e the value to match
74       * @return the greatest element less than or equal to given
75       * element, or <tt>null</tt> if there is no such element.
76 <     * @throws ClassCastException if o cannot be compared with the elements
76 >     * @throws ClassCastException if e cannot be compared with the elements
77       *            currently in the set.
78 <     * @throws NullPointerException if o is <tt>null</tt>.
78 >     * @throws NullPointerException if e is <tt>null</tt>.
79       * and this set does not permit <tt>null</tt> elements
80       */
81 <    public E floor(E o);
81 >    E floor(E e);
82  
83      /**
84       * Returns an element strictly greater than the given element, or
85       * <tt>null</tt> if there is no such element.
86       *
87 <     * @param o the value to match
87 >     * @param e the value to match
88       * @return the least element greater than the given element, or
89       * <tt>null</tt> if there is no such element.
90 <     * @throws ClassCastException if o cannot be compared with the elements
90 >     * @throws ClassCastException if e cannot be compared with the elements
91       *            currently in the set.
92 <     * @throws NullPointerException if o is <tt>null</tt>
92 >     * @throws NullPointerException if e is <tt>null</tt>
93       * and this set does not permit <tt>null</tt> elements
94       */
95 <    public E higher(E o);
95 >    E higher(E e);
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 134 | Line 139 | public interface NavigableSet<E> extends
139       *         <tt>toElement</tt> is <tt>null</tt>
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 150 | Line 155 | public interface NavigableSet<E> extends
155       * @throws NullPointerException if <tt>toElement</tt> is <tt>null</tt>
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 167 | Line 172 | public interface NavigableSet<E> extends
172       * @throws NullPointerException if <tt>fromElement</tt> is <tt>null</tt>
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