Interface ReadOnlyNavigableSet<E>

  • Type Parameters:
    E - the type of elements maintained by this set
    All Superinterfaces:
    java.lang.Iterable<E>, ReadOnlyCollection<E>, ReadOnlySequencedCollection<E>, ReadOnlySequencedSet<E>, ReadOnlySet<E>, ReadOnlySortedSet<E>
    All Known Implementing Classes:
    ReadOnlyTreeSet

    public interface ReadOnlyNavigableSet<E>
    extends ReadOnlySortedSet<E>
    This interface was originally copied from GitHub's Open-JDK Account. Though the original file has been modified, few changes have been applied to the Javadoc Commenting. Due to fact that that is a Java interface file, there were few method bodies with Source-Code to begin with - meaning this is largely a copy of Method-Signatures and Java-Doc Comments.

    Method and parameter names & types have not been modified whatsoever; but several methods had to be eliminated for not being Read-Only. This Source-File was copied from the original Open JDK-21 file of the same (or, rather, highly similar) Interface-Name. The original file may be viewed on the JDK-21 GitHub public (and, coincidentally, Read-Only) Source-Release archive for Java Package java.util.*

    The Original '.java' Source-File's Header-Copyright Information is included here: File Copyright. Within that Copyright Notice, it is suggested that a copy of the GNU Public License V2 also be included alongside.
    Immutable variant of Java Collections Framework interface java.util.NavigableSet<E>. This interface contains all of the methods that the standard Java interface ReadOnlyNavigableSet contains - except those which would directly or indirectly modify / mutate the internal data-structure.


    • Method Detail

      • lower

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

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

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

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

        🡅  🡇     🗕  🗗  🗖
        ReadOnlyNavigableSet<EdescendingSet()
        Returns a reverse order view of the elements contained in this set.

        The expression s.descendingSet().descendingSet() returns a view of s essentially equivalent to s.
        Returns:
        a reverse order view of this set
      • subSet

        🡅  🡇     🗕  🗗  🗖
        ReadOnlyNavigableSet<EsubSet​(E fromElement,
                                       boolean fromInclusive,
                                       E toElement,
                                       boolean toInclusive)
        Returns a view of the portion of this set whose elements range from fromElement to toElement. If fromElement and toElement are equal, the returned set is empty unless fromInclusive and toInclusive are both true. The returned set supports all optional set operations that this set supports.
        Parameters:
        fromElement - low endpoint of the returned set
        fromInclusive - TRUE if the low endpoint is to be included in the returned view
        toElement - high endpoint of the returned set
        toInclusive - TRUE if the high endpoint is to be included in the returned view
        Returns:
        a view of the portion of this set whose elements range from fromElement, inclusive, to toElement, exclusive
        Throws:
        java.lang.ClassCastException - if fromElement and toElement cannot be compared to one another using this set's comparator (or, if the 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 set.
        java.lang.NullPointerException - if fromElement or toElement is null and this set does not permit null elements
        java.lang.IllegalArgumentException - if fromElement is greater than toElement; or if this set itself has a restricted range, and fromElement or toElement lies outside the bounds of the range.
      • headSet

        🡅  🡇     🗕  🗗  🗖
        ReadOnlyNavigableSet<EheadSet​(E toElement,
                                        boolean inclusive)
        Returns a view of the portion of this set whose elements are less than (or equal to, if inclusive is true) toElement.
        Parameters:
        toElement - high endpoint of the returned set
        inclusive - TRUE if the high endpoint is to be included in the returned view
        Returns:
        a view of the portion of this set whose elements are less than (or equal to, if inclusive is true) toElement
        Throws:
        java.lang.ClassCastException - if toElement is not compatible with this set's comparator (or, if the 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 set.
        java.lang.NullPointerException - if toElement is null and this set does not permit null elements
        java.lang.IllegalArgumentException - if this set itself has a restricted range, and toElement lies outside the bounds of the range
      • tailSet

        🡅  🡇     🗕  🗗  🗖
        ReadOnlyNavigableSet<EtailSet​(E fromElement,
                                        boolean inclusive)
        Returns a view of the portion of this set whose elements are greater than (or equal to, if inclusive is true) fromElement.
        Parameters:
        fromElement - low endpoint of the returned set
        inclusive - TRUE if the low endpoint is to be included in the returned view
        Returns:
        a view of the portion of this set whose elements are greater than or equal to fromElement
        Throws:
        java.lang.ClassCastException - if fromElement is not compatible with this set's comparator (or, if the 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 set.
        java.lang.NullPointerException - if fromElement is null and this set does not permit null elements
        java.lang.IllegalArgumentException - if this set itself has a restricted range, and fromElement lies outside the bounds of the range
      • subSet

        🡅  🡇     🗕  🗗  🗖
        ReadOnlySortedSet<EsubSet​(E fromElement,
                                    E toElement)
        Returns a view of the portion of this set whose elements range from fromElement, inclusive, to toElement, exclusive. (If fromElement and toElement are equal, the returned set is empty.) The returned set supports all optional set operations that this set supports.

        Equivalent to subSet(fromElement, true, toElement, false).
        Specified by:
        subSet in interface ReadOnlySortedSet<E>
        Parameters:
        fromElement - low endpoint (inclusive) of the returned set
        toElement - high endpoint (exclusive) of the returned set
        Returns:
        a view of the portion of this set whose elements range from fromElement, inclusive, to toElement, exclusive
        Throws:
        java.lang.ClassCastException - if fromElement and toElement cannot be compared to one another using this set's comparator (or, if the 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 set.
        java.lang.NullPointerException - if fromElement or toElement is null and this set does not permit null elements
        java.lang.IllegalArgumentException - if fromElement is greater than toElement; or if this set itself has a restricted range, and fromElement or toElement lies outside the bounds of the range
      • headSet

        🡅  🡇     🗕  🗗  🗖
        ReadOnlySortedSet<EheadSet​(E toElement)
        Returns a view of the portion of this set whose elements are strictly less than toElement. The returned set supports all optional set operations that this set supports.

        Equivalent to headSet(toElement, false).
        Specified by:
        headSet in interface ReadOnlySortedSet<E>
        Parameters:
        toElement - high endpoint (exclusive) of the returned set
        Returns:
        a view of the portion of this set whose elements are strictly less than toElement
        Throws:
        java.lang.ClassCastException - if toElement is not compatible with this set's comparator (or, if the 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 set.
        java.lang.NullPointerException - if toElement is null and this set does not permit null elements
        java.lang.IllegalArgumentException - if this set itself has a restricted range, and toElement lies outside the bounds of the range
      • tailSet

        🡅  🡇     🗕  🗗  🗖
        ReadOnlySortedSet<EtailSet​(E fromElement)
        Returns a view of the portion of this set whose elements are greater than or equal to fromElement. The returned set supports all optional set operations that this set supports.

        Equivalent to tailSet(fromElement, true).
        Specified by:
        tailSet in interface ReadOnlySortedSet<E>
        Parameters:
        fromElement - low endpoint (inclusive) of the returned set
        Returns:
        a view of the portion of this set whose elements are greater than or equal to fromElement
        Throws:
        java.lang.ClassCastException - if fromElement is not compatible with this set's comparator (or, if the 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 set.
        java.lang.NullPointerException - if fromElement is null and this set does not permit null elements
        java.lang.IllegalArgumentException - if this set itself has a restricted range, and fromElement lies outside the bounds of the range