155 * @return the last element, or {@code null} if this set is empty
156 */
157 E pollLast();
158
159 /**
160 * Returns an iterator over the elements in this set, in ascending order.
161 *
162 * @return an iterator over the elements in this set, in ascending order
163 */
164 Iterator<E> iterator();
165
166 /**
167 * Returns a reverse order view of the elements contained in this set.
168 * The descending set is backed by this set, so changes to the set are
169 * reflected in the descending set, and vice-versa. If either set is
170 * modified while an iteration over either set is in progress (except
171 * through the iterator's own {@code remove} operation), the results of
172 * the iteration are undefined.
173 *
174 * <p>The returned set has an ordering equivalent to
175 * <tt>{@link Collections#reverseOrder(Comparator) Collections.reverseOrder}(comparator())</tt>.
176 * The expression {@code s.descendingSet().descendingSet()} returns a
177 * view of {@code s} essentially equivalent to {@code s}.
178 *
179 * @return a reverse order view of this set
180 */
181 NavigableSet<E> descendingSet();
182
183 /**
184 * Returns an iterator over the elements in this set, in descending order.
185 * Equivalent in effect to {@code descendingSet().iterator()}.
186 *
187 * @return an iterator over the elements in this set, in descending order
188 */
189 Iterator<E> descendingIterator();
190
191 /**
192 * Returns a view of the portion of this set whose elements range from
193 * {@code fromElement} to {@code toElement}. If {@code fromElement} and
194 * {@code toElement} are equal, the returned set is empty unless {@code
195 * fromInclusive} and {@code toInclusive} are both true. The returned set
|
155 * @return the last element, or {@code null} if this set is empty
156 */
157 E pollLast();
158
159 /**
160 * Returns an iterator over the elements in this set, in ascending order.
161 *
162 * @return an iterator over the elements in this set, in ascending order
163 */
164 Iterator<E> iterator();
165
166 /**
167 * Returns a reverse order view of the elements contained in this set.
168 * The descending set is backed by this set, so changes to the set are
169 * reflected in the descending set, and vice-versa. If either set is
170 * modified while an iteration over either set is in progress (except
171 * through the iterator's own {@code remove} operation), the results of
172 * the iteration are undefined.
173 *
174 * <p>The returned set has an ordering equivalent to
175 * {@link Collections#reverseOrder(Comparator) Collections.reverseOrder(comparator())}.
176 * The expression {@code s.descendingSet().descendingSet()} returns a
177 * view of {@code s} essentially equivalent to {@code s}.
178 *
179 * @return a reverse order view of this set
180 */
181 NavigableSet<E> descendingSet();
182
183 /**
184 * Returns an iterator over the elements in this set, in descending order.
185 * Equivalent in effect to {@code descendingSet().iterator()}.
186 *
187 * @return an iterator over the elements in this set, in descending order
188 */
189 Iterator<E> descendingIterator();
190
191 /**
192 * Returns a view of the portion of this set whose elements range from
193 * {@code fromElement} to {@code toElement}. If {@code fromElement} and
194 * {@code toElement} are equal, the returned set is empty unless {@code
195 * fromInclusive} and {@code toInclusive} are both true. The returned set
|