Code example for NavigableSet

Methods: descendingIteratorheadSet

0
   * A sensible definition of {@link #lower} in terms of the {@code descendingIterator} method of 
   * {@link #headSet(Object, boolean)}. If you override {@link #headSet(Object, boolean)}, you may 
   * wish to override {@link #lower} to forward to this implementation. 
   */ 
  protected E standardLower(E e) {
    return Iterators.getNext(headSet(e, false).descendingIterator(), null);
  } 
 
  @Override 
  public E floor(E e) {
    return delegate().floor(e);
  } 
 
  /** 
   * A sensible definition of {@link #floor} in terms of the {@code descendingIterator} method of 
   * {@link #headSet(Object, boolean)}. If you override {@link #headSet(Object, boolean)}, you may 
   * wish to override {@link #floor} to forward to this implementation. 
   */ 
  protected E standardFloor(E e) {
    return Iterators.getNext(headSet(e, true).descendingIterator(), null);
  } 
 
  @Override 
  public E ceiling(E e) {
    return delegate().ceiling(e);
  } 
 
  /** 
   * A sensible definition of {@link #ceiling} in terms of the {@code iterator} method of 
   * {@link #tailSet(Object, boolean)}. If you override {@link #tailSet(Object, boolean)}, you may 
   * wish to override {@link #ceiling} to forward to this implementation. 
   */ 
  protected E standardCeiling(E e) {
    return Iterators.getNext(tailSet(e, true).iterator(), null);
  } 
 
  @Override 
  public E higher(E e) {
    return delegate().higher(e);
  } 
 
  /** 
   * A sensible definition of {@link #higher} in terms of the {@code iterator} method of 
   * {@link #tailSet(Object, boolean)}. If you override {@link #tailSet(Object, boolean)}, you may 
   * wish to override {@link #higher} to forward to this implementation. 
   */ 
  protected E standardHigher(E e) {
    return Iterators.getNext(tailSet(e, false).iterator(), null);
  } 
 
  @Override 
  public E pollFirst() { 
    return delegate().pollFirst();
  } 
 
  /** 
   * A sensible definition of {@link #pollFirst} in terms of the {@code iterator} method. If you 
   * override {@link #iterator} you may wish to override {@link #pollFirst} to forward to this 
   * implementation. 
   */ 
  protected E standardPollFirst() { 
    return poll(iterator());
  } 
 
  @Override 
  public E pollLast() { 
    return delegate().pollLast();
  } 
 
  /** 
   * A sensible definition of {@link #pollLast} in terms of the {@code descendingIterator} method. 
   * If you override {@link #descendingIterator} you may wish to override {@link #pollLast} to 
   * forward to this implementation. 
   */ 
  protected E standardPollLast() { 
    return poll(delegate().descendingIterator());
  } 
 
  protected E standardFirst() { 
    return iterator().next();
  } 
 
  protected E standardLast() { 
    return descendingIterator().next();
  } 
 
  @Override 
  public NavigableSet<E> descendingSet() {
    return delegate().descendingSet();
  } 
 
  /** 
   * A sensible implementation of {@link NavigableSet#descendingSet} in terms of the other methods 
   * of {@link NavigableSet}, notably including {@link NavigableSet#descendingIterator}. 
   * 
   * <p>In many cases, you may wish to override {@link ForwardingNavigableSet#descendingSet} to 
   * forward to this implementation or a subclass thereof. 
   * 
   * @since 12.0 
   */ 
  @Beta 
  protected class StandardDescendingSet extends Sets.DescendingSet<E> { 
    /** Constructor for use by subclasses. */ 
    public StandardDescendingSet() { 
      super(ForwardingNavigableSet.this);
    } 
  } 
 
  @Override 
  public Iterator<E> descendingIterator() {
    return delegate().descendingIterator();
  } 
 
  @Override 
  public NavigableSet<E> subSet(
      E fromElement,
      boolean fromInclusive,
      E toElement,
      boolean toInclusive) {
    return delegate().subSet(fromElement, fromInclusive, toElement, toInclusive);
  } 
 
  /** 
   * A sensible definition of {@link #subSet(Object, boolean, Object, boolean)} in terms of the 
   * {@code headSet} and {@code tailSet} methods. In many cases, you may wish to override 
   * {@link #subSet(Object, boolean, Object, boolean)} to forward to this implementation. 
   */ 
  protected NavigableSet<E> standardSubSet(
      E fromElement,
      boolean fromInclusive,
      E toElement,
      boolean toInclusive) {
    return tailSet(fromElement, fromInclusive).headSet(toElement, toInclusive);
  } 
 
  /** 
   * A sensible definition of {@link #subSet(Object, Object)} in terms of the 
   * {@link #subSet(Object, boolean, Object, boolean)} method. If you override 
   * {@link #subSet(Object, boolean, Object, boolean)}, you may wish to override 
   * {@link #subSet(Object, Object)} to forward to this implementation. 
   */ 
  @Override 
  protected SortedSet<E> standardSubSet(E fromElement, E toElement) {
    return subSet(fromElement, true, toElement, false);
  } 
 
  @Override 
  public NavigableSet<E> headSet(E toElement, boolean inclusive) {
    return delegate().headSet(toElement, inclusive);
  } 
 
  /** 
   * A sensible definition of {@link #headSet(Object)} in terms of the 
   * {@link #headSet(Object, boolean)} method. If you override 
Contextual code suggestions in your IDE  Get Codota for Java