NavigableSet (Java SE 26 & JDK 26)
- Type Parameters:
E- the type of elements maintained by this set
- All Superinterfaces:
Collection<E>, Iterable<E>, SequencedCollection<E>, SequencedSet<E>, Set<E>, SortedSet<E>
- All Known Implementing Classes:
ConcurrentSkipListSet, TreeSet
-
Method Summary
Returns the least element in this set greater than or equal to the given element, or
nullif there is no such element.Returns an iterator over the elements in this set, in descending order.
Returns a reverse order view of the elements contained in this set.
Returns the greatest element in this set less than or equal to the given element, or
nullif there is no such element.Returns a view of the portion of this set whose elements are strictly less than
toElement.headSet(E toElement, boolean inclusive) Returns a view of the portion of this set whose elements are less than (or equal to, if
inclusiveis true)toElement.Returns the least element in this set strictly greater than the given element, or
nullif there is no such element.iterator()Returns an iterator over the elements in this set, in ascending order.
Returns the greatest element in this set strictly less than the given element, or
nullif there is no such element.Retrieves and removes the first (lowest) element, or returns
nullif this set is empty (optional operation).pollLast()Retrieves and removes the last (highest) element, or returns
nullif this set is empty (optional operation).default ERemoves and returns the first element of this collection (optional operation).
default ERemoves and returns the last element of this collection (optional operation).
reversed()Returns a reverse-ordered view of this collection.
subSet(E fromElement, boolean fromInclusive, E toElement, boolean toInclusive) Returns a view of the portion of this set whose elements range from
fromElementtotoElement.subSet(E fromElement, E toElement) Returns a view of the portion of this set whose elements range from
fromElement, inclusive, totoElement, exclusive.Returns a view of the portion of this set whose elements are greater than or equal to
fromElement.tailSet(E fromElement, boolean inclusive) Returns a view of the portion of this set whose elements are greater than (or equal to, if
inclusiveis true)fromElement.Methods declared in interface Collection
parallelStream, removeIf, stream, toArrayReturns a possibly parallel
Streamwith this collection as its source.default booleanRemoves all of the elements of this collection that satisfy the given predicate (optional operation).
Returns a sequential
Streamwith this collection as its source.default <T> T[]Returns an array containing all of the elements in this collection, using the provided
generatorfunction to allocate the returned array.Methods declared in interface Iterable
default voidPerforms the given action for each element of the
Iterableuntil all elements have been processed or the action throws an exception.Methods declared in interface Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, size, toArray, toArraybooleanAdds the specified element to this set if it is not already present (optional operation).
booleanAdds all of the elements in the specified collection to this set if they're not already present (optional operation).
voidRemoves all of the elements from this set (optional operation).
booleanReturns
trueif this set contains the specified element.booleanReturns
trueif this set contains all of the elements of the specified collection.booleanCompares the specified object with this set for equality.
intReturns the hash code value for this set.
booleanReturns
trueif this set contains no elements.booleanRemoves the specified element from this set if it is present (optional operation).
booleanRemoves from this set all of its elements that are contained in the specified collection (optional operation).
booleanRetains only the elements in this set that are contained in the specified collection (optional operation).
intReturns the number of elements in this set (its cardinality).
Returns an array containing all of the elements in this set.
<T> T[]Returns an array containing all of the elements in this set; the runtime type of the returned array is that of the specified array.
Methods declared in interface SortedSet
addFirst, addLast, comparator, first, getFirst, getLast, last, spliteratordefault voidThrows
UnsupportedOperationException.default voidThrows
UnsupportedOperationException.Returns the comparator used to order the elements in this set, or
nullif this set uses the natural ordering of its elements.Returns the first (lowest) element currently in this set.
default EGets the first element of this collection.
default EGets the last element of this collection.
Returns the last (highest) element currently in this set.
Creates a
Spliteratorover the elements in this sorted set.
-
Method Details
-
lower
-
floor
-
ceiling
-
higher
-
pollFirst
-
pollLast
-
iterator
-
descendingSet
-
descendingIterator
-
subSet
-
headSet
-
tailSet
-
subSet
-
headSet
-
tailSet
-
removeFirst
-
removeLast
-
reversed
-