Interface ImmutableNavigableSet<E>

    • Method Detail

      • lower

        E lower​(E e)
        Returns the greatest element in this immutable set strictly less than the given element, or null if there is no such element.
        Parameters:
        e - E; the value to match
        Returns:
        the greatest element less than e, or null if there is no such element
        Throws:
        ClassCastException - if the specified element cannot be compared with the elements currently in the immutable set
        NullPointerException - if the specified element is null and this immutable set does not permit null elements
      • floor

        E floor​(E e)
        Returns the greatest element in this immutable set less than or equal to the given element, or null if there is no such element.
        Parameters:
        e - E; the value to match
        Returns:
        the greatest element less than or equal to e, or null if there is no such element
        Throws:
        ClassCastException - if the specified element cannot be compared with the elements currently in the immutable set
        NullPointerException - if the specified element is null and this immutable set does not permit null elements
      • ceiling

        E ceiling​(E e)
        Returns the least element in this immutable set greater than or equal to the given element, or null if there is no such element.
        Parameters:
        e - E; the value to match
        Returns:
        the least element greater than or equal to e, or null if there is no such element
        Throws:
        ClassCastException - if the specified element cannot be compared with the elements currently in the immutable set
        NullPointerException - if the specified element is null and this immutable set does not permit null elements
      • higher

        E higher​(E e)
        Returns the least element in this immutable set strictly greater than the given element, or null if there is no such element.
        Parameters:
        e - E; the value to match
        Returns:
        the least element greater than e, or null if there is no such element
        Throws:
        ClassCastException - if the specified element cannot be compared with the elements currently in the immutable set
        NullPointerException - if the specified element is null and this immutable set does not permit null elements
      • descendingSet

        ImmutableNavigableSet<E> descendingSet()
        Returns a reverse order view of the elements contained in this immutable set.

        The returned immutable set has an ordering equivalent to Collections.reverseOrder(comparator()). The expression s.descendingSet().descendingSet() returns a view of s essentially equivalent to s.

        Returns:
        a reverse order view of this immutable set
      • descendingIterator

        ImmutableIterator<E> descendingIterator()
        Returns an immutable iterator over the elements in this immutable set, in descending order. Equivalent in effect to descendingSet().iterator().
        Returns:
        an immutable iterator over the elements in this immutable set, in descending order
      • subSet

        ImmutableNavigableSet<E> subSet​(E fromElement,
                                        boolean fromInclusive,
                                        E toElement,
                                        boolean toInclusive)
        Returns a view of the portion of this immutable set whose elements range from fromElement to toElement. If fromElement and toElement are equal, the returned immutable set is empty unless fromInclusive and toInclusive are both true.
        Parameters:
        fromElement - E; low endpoint of the returned immutable set
        fromInclusive - boolean; true if the low endpoint is to be included in the returned view
        toElement - E; high endpoint of the returned immutable set
        toInclusive - boolean; true if the high endpoint is to be included in the returned view
        Returns:
        a view of the portion of this immutable set whose elements range from fromElement, inclusive, to toElement, exclusive
        Throws:
        ClassCastException - if fromElement and toElement cannot be compared to one another using this immutable set's comparator (or, if the immutable set has no comparator, using natural ordering). Implementations may, but are not required to, throw this exception if fromElement or toElement cannot be compared to elements currently in the immutable set.
        NullPointerException - if fromElement or toElement is null and this immutable set does not permit null elements
        IllegalArgumentException - if fromElement is greater than toElement; or if this immutable set itself has a restricted range, and fromElement or toElement lies outside the bounds of the range.
      • headSet

        ImmutableNavigableSet<E> headSet​(E toElement,
                                         boolean inclusive)
        Returns a view of the portion of this immutable set whose elements are less than (or equal to, if inclusive is true) toElement.
        Parameters:
        toElement - E; high endpoint of the returned immutable set
        inclusive - boolean; true if the high endpoint is to be included in the returned view
        Returns:
        a view of the portion of this immutable set whose elements are less than (or equal to, if inclusive is true) toElement
        Throws:
        ClassCastException - if toElement is not compatible with this immutable set's comparator (or, if the immutable set has no comparator, if toElement does not implement Comparable). Implementations may, but are not required to, throw this exception if toElement cannot be compared to elements currently in the immutable set.
        NullPointerException - if toElement is null and this immutable set does not permit null elements
        IllegalArgumentException - if this immutable set itself has a restricted range, and toElement lies outside the bounds of the range
      • tailSet

        ImmutableNavigableSet<E> tailSet​(E fromElement,
                                         boolean inclusive)
        Returns a view of the portion of this immutable set whose elements are greater than (or equal to, if inclusive is true) fromElement.
        Parameters:
        fromElement - E; low endpoint of the returned immutable set
        inclusive - boolean; true if the low endpoint is to be included in the returned view
        Returns:
        a view of the portion of this immutable set whose elements are greater than or equal to fromElement
        Throws:
        ClassCastException - if fromElement is not compatible with this immutable set's comparator (or, if the immutable set has no comparator, if fromElement does not implement Comparable). Implementations may, but are not required to, throw this exception if fromElement cannot be compared to elements currently in the immutable set.
        NullPointerException - if fromElement is null and this immutable set does not permit null elements
        IllegalArgumentException - if this immutable set itself has a restricted range, and fromElement lies outside the bounds of the range