Class ForwardingNavigableSet<E>

  • All Implemented Interfaces:
    java.lang.Iterable<E>, java.util.Collection<E>, java.util.NavigableSet<E>, java.util.Set<E>, java.util.SortedSet<E>

    public abstract class ForwardingNavigableSet<E>
    extends ForwardingSortedSet<E>
    implements java.util.NavigableSet<E>
    A navigable set which forwards all its method calls to another navigable set. Subclasses should override one or more methods to modify the behavior of the backing set as desired per the decorator pattern.

    Warning: The methods of ForwardingNavigableSet forward indiscriminately to the methods of the delegate. For example, overriding ForwardingCollection.add(E) alone will not change the behavior of ForwardingCollection.addAll(java.util.Collection<? extends E>), which can lead to unexpected behavior. In this case, you should override addAll as well, either providing your own implementation, or delegating to the provided standardAddAll method.

    Each of the standard methods uses the set's comparator (or the natural ordering of the elements, if there is no comparator) to test element equality. As a result, if the comparator is not consistent with equals, some of the standard implementations may violate the Set contract.

    The standard methods and the collection views they return are not guaranteed to be thread-safe, even when all of the methods that they depend on are thread-safe.

    Since:
    12.0
    • Method Detail

      • lower

        public E lower​(E e)
        Specified by:
        lower in interface java.util.NavigableSet<E>
      • floor

        public E floor​(E e)
        Specified by:
        floor in interface java.util.NavigableSet<E>
      • ceiling

        public E ceiling​(E e)
        Specified by:
        ceiling in interface java.util.NavigableSet<E>
      • higher

        public E higher​(E e)
        Specified by:
        higher in interface java.util.NavigableSet<E>
      • pollFirst

        public E pollFirst()
        Specified by:
        pollFirst in interface java.util.NavigableSet<E>
      • pollLast

        public E pollLast()
        Specified by:
        pollLast in interface java.util.NavigableSet<E>
      • descendingSet

        public java.util.NavigableSet<E> descendingSet()
        Specified by:
        descendingSet in interface java.util.NavigableSet<E>
      • descendingIterator

        public java.util.Iterator<E> descendingIterator()
        Specified by:
        descendingIterator in interface java.util.NavigableSet<E>
      • subSet

        public java.util.NavigableSet<E> subSet​(E fromElement,
                                                boolean fromInclusive,
                                                E toElement,
                                                boolean toInclusive)
        Specified by:
        subSet in interface java.util.NavigableSet<E>
      • headSet

        public java.util.NavigableSet<E> headSet​(E toElement,
                                                 boolean inclusive)
        Specified by:
        headSet in interface java.util.NavigableSet<E>
      • tailSet

        public java.util.NavigableSet<E> tailSet​(E fromElement,
                                                 boolean inclusive)
        Specified by:
        tailSet in interface java.util.NavigableSet<E>