Interface ObjectSortedSet<K>
- All Superinterfaces:
Collection<K>,Iterable<K>,it.unimi.dsi.fastutil.objects.ObjectBidirectionalIterable<K>,it.unimi.dsi.fastutil.objects.ObjectCollection<K>,it.unimi.dsi.fastutil.objects.ObjectIterable<K>,ObjectSet<K>,SequencedCollection<K>,SequencedSet<K>,Set<K>,SortedSet<K>
- All Known Implementing Classes:
AbstractObjectSortedSet,ObjectAVLTreeSet,ObjectLinkedOpenCustomHashSet,ObjectLinkedOpenHashSet,ObjectRBTreeSet,ObjectSortedSets.EmptySet,ObjectSortedSets.Singleton,ObjectSortedSets.SynchronizedSortedSet,ObjectSortedSets.UnmodifiableSortedSet
SortedSet; provides some additional methods that use polymorphism to avoid (un)boxing.
Additionally, this interface strengthens iterator(),
SortedSet.comparator() (for primitive types), SortedSet.subSet(Object,Object),
SortedSet.headSet(Object) and SortedSet.tailSet(Object).
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionReturns a view of the portion of this sorted set whose elements are strictly less thantoElement.it.unimi.dsi.fastutil.objects.ObjectBidirectionalIterator<K> iterator()Returns a type-specificBidirectionalIteratoron the elements in this set.it.unimi.dsi.fastutil.objects.ObjectBidirectionalIterator<K> Returns a type-specificBidirectionalIteratoron the elements in this set, starting from a given element of the domain (optional operation).default it.unimi.dsi.fastutil.objects.ObjectSpliterator<K> Returns a type-specific spliterator on the elements of this sorted-set.Returns a view of the portion of this sorted set whose elements range fromfromElement, inclusive, totoElement, exclusive.Returns a view of the portion of this sorted set whose elements are greater than or equal tofromElement.Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, size, toArray, toArrayMethods inherited from interface java.util.SortedSet
addFirst, addLast, comparator, first, getFirst, getLast, last, removeFirst, removeLast, reversed
-
Method Details
-
iterator
Returns a type-specificBidirectionalIteratoron the elements in this set, starting from a given element of the domain (optional operation).This method returns a type-specific bidirectional iterator with given starting point. The starting point is any element comparable to the elements of this set (even if it does not actually belong to the set). The next element of the returned iterator is the least element of the set that is greater than the starting point (if there are no elements greater than the starting point,
hasNext()will returnfalse). The previous element of the returned iterator is the greatest element of the set that is smaller than or equal to the starting point (if there are no elements smaller than or equal to the starting point,hasPrevious()will returnfalse).Note that passing the last element of the set as starting point and calling
previous()you can traverse the entire set in reverse order.- Parameters:
fromElement- an element to start from.- Returns:
- a bidirectional iterator on the element in this set, starting at the given element.
- Throws:
UnsupportedOperationException- if this set does not support iterators with a starting point.
-
iterator
it.unimi.dsi.fastutil.objects.ObjectBidirectionalIterator<K> iterator()Returns a type-specificBidirectionalIteratoron the elements in this set.This method returns a parameterised bidirectional iterator. The iterator can be moreover safely cast to a type-specific iterator.
- Specified by:
iteratorin interfaceCollection<K>- Specified by:
iteratorin interfaceIterable<K>- Specified by:
iteratorin interfaceit.unimi.dsi.fastutil.objects.ObjectBidirectionalIterable<K>- Specified by:
iteratorin interfaceit.unimi.dsi.fastutil.objects.ObjectCollection<K>- Specified by:
iteratorin interfaceit.unimi.dsi.fastutil.objects.ObjectIterable<K>- Specified by:
iteratorin interfaceObjectSet<K>- Specified by:
iteratorin interfaceSet<K>- Returns:
- a bidirectional iterator on the element in this set.
-
spliterator
Returns a type-specific spliterator on the elements of this sorted-set.SortedSet spliterators must report at least
Spliterator.DISTINCT,Spliterator.ORDERED, andSpliterator.SORTED. The returned spliterator'sgetComparator()must be the same (or at the very least, consistent with) this instance'sSortedSet.comparator().See
SortedSet.spliterator()for more documentation on the requirements of the returned spliterator.- Specified by:
spliteratorin interfaceCollection<K>- Specified by:
spliteratorin interfaceIterable<K>- Specified by:
spliteratorin interfaceit.unimi.dsi.fastutil.objects.ObjectCollection<K>- Specified by:
spliteratorin interfaceit.unimi.dsi.fastutil.objects.ObjectIterable<K>- Specified by:
spliteratorin interfaceObjectSet<K>- Specified by:
spliteratorin interfaceSet<K>- Specified by:
spliteratorin interfaceSortedSet<K>- Returns:
- Since:
- 8.5.0
-
subSet
Returns a view of the portion of this sorted set whose elements range fromfromElement, inclusive, totoElement, exclusive. -
headSet
Returns a view of the portion of this sorted set whose elements are strictly less thantoElement. -
tailSet
Returns a view of the portion of this sorted set whose elements are greater than or equal tofromElement.
-