167 |
|
* Returns an iterator over the elements in this set in descending order. |
168 |
|
* |
169 |
|
* @return an iterator over the elements in this set in descending order |
170 |
+ |
* @since 1.6 |
171 |
|
*/ |
172 |
|
public Iterator<E> descendingIterator() { |
173 |
|
return m.descendingKeySet().iterator(); |
293 |
|
* <tt>toElement</tt> is null and this set uses natural ordering, |
294 |
|
* or its comparator does not permit null elements |
295 |
|
* @throws IllegalArgumentException {@inheritDoc} |
296 |
+ |
* @since 1.6 |
297 |
|
*/ |
298 |
|
public NavigableSet<E> navigableSubSet(E fromElement, E toElement) { |
299 |
|
return new TreeSet<E>(m.navigableSubMap(fromElement, toElement)); |
305 |
|
* this set uses natural ordering, or its comparator does |
306 |
|
* not permit null elements |
307 |
|
* @throws IllegalArgumentException {@inheritDoc} |
308 |
+ |
* @since 1.6 |
309 |
|
*/ |
310 |
|
public NavigableSet<E> navigableHeadSet(E toElement) { |
311 |
|
return new TreeSet<E>(m.navigableHeadMap(toElement)); |
317 |
|
* this set uses natural ordering, or its comparator does |
318 |
|
* not permit null elements |
319 |
|
* @throws IllegalArgumentException {@inheritDoc} |
320 |
+ |
* @since 1.6 |
321 |
|
*/ |
322 |
|
public NavigableSet<E> navigableTailSet(E fromElement) { |
323 |
|
return new TreeSet<E>(m.navigableTailMap(fromElement)); |
396 |
|
* @throws NullPointerException if the specified element is null |
397 |
|
* and this set uses natural ordering, or its comparator |
398 |
|
* does not permit null elements |
399 |
+ |
* @since 1.6 |
400 |
|
*/ |
401 |
|
public E lower(E e) { |
402 |
|
return m.lowerKey(e); |
407 |
|
* @throws NullPointerException if the specified element is null |
408 |
|
* and this set uses natural ordering, or its comparator |
409 |
|
* does not permit null elements |
410 |
+ |
* @since 1.6 |
411 |
|
*/ |
412 |
|
public E floor(E e) { |
413 |
|
return m.floorKey(e); |
418 |
|
* @throws NullPointerException if the specified element is null |
419 |
|
* and this set uses natural ordering, or its comparator |
420 |
|
* does not permit null elements |
421 |
+ |
* @since 1.6 |
422 |
|
*/ |
423 |
|
public E ceiling(E e) { |
424 |
|
return m.ceilingKey(e); |
429 |
|
* @throws NullPointerException if the specified element is null |
430 |
|
* and this set uses natural ordering, or its comparator |
431 |
|
* does not permit null elements |
432 |
+ |
* @since 1.6 |
433 |
|
*/ |
434 |
|
public E higher(E e) { |
435 |
|
return m.higherKey(e); |
436 |
|
} |
437 |
|
|
438 |
+ |
/** |
439 |
+ |
* @since 1.6 |
440 |
+ |
*/ |
441 |
|
public E pollFirst() { |
442 |
|
Map.Entry<E,?> e = m.pollFirstEntry(); |
443 |
|
return (e == null)? null : e.getKey(); |
444 |
|
} |
445 |
|
|
446 |
+ |
/** |
447 |
+ |
* @since 1.6 |
448 |
+ |
*/ |
449 |
|
public E pollLast() { |
450 |
|
Map.Entry<E,?> e = m.pollLastEntry(); |
451 |
|
return (e == null)? null : e.getKey(); |