Interface ObjectSortedSet<K>
- All Superinterfaces:
Collection<K>
,Iterable<K>
,ObjectBidirectionalIterable<K>
,ObjectCollection<K>
,ObjectIterable<K>
,ObjectSet<K>
,SequencedCollection<K>
,SequencedSet<K>
,Set<K>
,SortedSet<K>
- All Known Subinterfaces:
Byte2BooleanSortedMap.FastSortedEntrySet
,Byte2ByteSortedMap.FastSortedEntrySet
,Byte2CharSortedMap.FastSortedEntrySet
,Byte2DoubleSortedMap.FastSortedEntrySet
,Byte2FloatSortedMap.FastSortedEntrySet
,Byte2IntSortedMap.FastSortedEntrySet
,Byte2LongSortedMap.FastSortedEntrySet
,Byte2ObjectSortedMap.FastSortedEntrySet<V>
,Byte2ReferenceSortedMap.FastSortedEntrySet<V>
,Byte2ShortSortedMap.FastSortedEntrySet
,Char2BooleanSortedMap.FastSortedEntrySet
,Char2ByteSortedMap.FastSortedEntrySet
,Char2CharSortedMap.FastSortedEntrySet
,Char2DoubleSortedMap.FastSortedEntrySet
,Char2FloatSortedMap.FastSortedEntrySet
,Char2IntSortedMap.FastSortedEntrySet
,Char2LongSortedMap.FastSortedEntrySet
,Char2ObjectSortedMap.FastSortedEntrySet<V>
,Char2ReferenceSortedMap.FastSortedEntrySet<V>
,Char2ShortSortedMap.FastSortedEntrySet
,Double2BooleanSortedMap.FastSortedEntrySet
,Double2ByteSortedMap.FastSortedEntrySet
,Double2CharSortedMap.FastSortedEntrySet
,Double2DoubleSortedMap.FastSortedEntrySet
,Double2FloatSortedMap.FastSortedEntrySet
,Double2IntSortedMap.FastSortedEntrySet
,Double2LongSortedMap.FastSortedEntrySet
,Double2ObjectSortedMap.FastSortedEntrySet<V>
,Double2ReferenceSortedMap.FastSortedEntrySet<V>
,Double2ShortSortedMap.FastSortedEntrySet
,Float2BooleanSortedMap.FastSortedEntrySet
,Float2ByteSortedMap.FastSortedEntrySet
,Float2CharSortedMap.FastSortedEntrySet
,Float2DoubleSortedMap.FastSortedEntrySet
,Float2FloatSortedMap.FastSortedEntrySet
,Float2IntSortedMap.FastSortedEntrySet
,Float2LongSortedMap.FastSortedEntrySet
,Float2ObjectSortedMap.FastSortedEntrySet<V>
,Float2ReferenceSortedMap.FastSortedEntrySet<V>
,Float2ShortSortedMap.FastSortedEntrySet
,Int2BooleanSortedMap.FastSortedEntrySet
,Int2ByteSortedMap.FastSortedEntrySet
,Int2CharSortedMap.FastSortedEntrySet
,Int2DoubleSortedMap.FastSortedEntrySet
,Int2FloatSortedMap.FastSortedEntrySet
,Int2IntSortedMap.FastSortedEntrySet
,Int2LongSortedMap.FastSortedEntrySet
,Int2ObjectSortedMap.FastSortedEntrySet<V>
,Int2ReferenceSortedMap.FastSortedEntrySet<V>
,Int2ShortSortedMap.FastSortedEntrySet
,Long2BooleanSortedMap.FastSortedEntrySet
,Long2ByteSortedMap.FastSortedEntrySet
,Long2CharSortedMap.FastSortedEntrySet
,Long2DoubleSortedMap.FastSortedEntrySet
,Long2FloatSortedMap.FastSortedEntrySet
,Long2IntSortedMap.FastSortedEntrySet
,Long2LongSortedMap.FastSortedEntrySet
,Long2ObjectSortedMap.FastSortedEntrySet<V>
,Long2ReferenceSortedMap.FastSortedEntrySet<V>
,Long2ShortSortedMap.FastSortedEntrySet
,Object2BooleanSortedMap.FastSortedEntrySet<K>
,Object2ByteSortedMap.FastSortedEntrySet<K>
,Object2CharSortedMap.FastSortedEntrySet<K>
,Object2DoubleSortedMap.FastSortedEntrySet<K>
,Object2FloatSortedMap.FastSortedEntrySet<K>
,Object2IntSortedMap.FastSortedEntrySet<K>
,Object2LongSortedMap.FastSortedEntrySet<K>
,Object2ObjectSortedMap.FastSortedEntrySet<K,
,V> Object2ReferenceSortedMap.FastSortedEntrySet<K,
,V> Object2ShortSortedMap.FastSortedEntrySet<K>
,Reference2BooleanSortedMap.FastSortedEntrySet<K>
,Reference2ByteSortedMap.FastSortedEntrySet<K>
,Reference2CharSortedMap.FastSortedEntrySet<K>
,Reference2DoubleSortedMap.FastSortedEntrySet<K>
,Reference2FloatSortedMap.FastSortedEntrySet<K>
,Reference2IntSortedMap.FastSortedEntrySet<K>
,Reference2LongSortedMap.FastSortedEntrySet<K>
,Reference2ObjectSortedMap.FastSortedEntrySet<K,
,V> Reference2ReferenceSortedMap.FastSortedEntrySet<K,
,V> Reference2ShortSortedMap.FastSortedEntrySet<K>
,Short2BooleanSortedMap.FastSortedEntrySet
,Short2ByteSortedMap.FastSortedEntrySet
,Short2CharSortedMap.FastSortedEntrySet
,Short2DoubleSortedMap.FastSortedEntrySet
,Short2FloatSortedMap.FastSortedEntrySet
,Short2IntSortedMap.FastSortedEntrySet
,Short2LongSortedMap.FastSortedEntrySet
,Short2ObjectSortedMap.FastSortedEntrySet<V>
,Short2ReferenceSortedMap.FastSortedEntrySet<V>
,Short2ShortSortedMap.FastSortedEntrySet
- 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
.iterator()
Returns a type-specificBidirectionalIterator
on the elements in this set.Returns a type-specificBidirectionalIterator
on the elements in this set, starting from a given element of the domain (optional operation).default 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, toArray
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, remove, removeAll, retainAll, size, toArray, toArray
Methods inherited from interface java.util.SortedSet
addFirst, addLast, comparator, first, getFirst, getLast, last, removeFirst, removeLast, reversed
-
Method Details
-
iterator
Returns a type-specificBidirectionalIterator
on 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
ObjectBidirectionalIterator<K> iterator()Returns a type-specificBidirectionalIterator
on 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:
iterator
in interfaceCollection<K>
- Specified by:
iterator
in interfaceIterable<K>
- Specified by:
iterator
in interfaceObjectBidirectionalIterable<K>
- Specified by:
iterator
in interfaceObjectCollection<K>
- Specified by:
iterator
in interfaceObjectIterable<K>
- Specified by:
iterator
in interfaceObjectSet<K>
- Specified by:
iterator
in interfaceSet<K>
- Returns:
- a bidirectional iterator on the element in this set.
- See Also:
- API Notes:
- This specification strengthens the one given in the corresponding type-specific
Collection
.
-
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:
spliterator
in interfaceCollection<K>
- Specified by:
spliterator
in interfaceIterable<K>
- Specified by:
spliterator
in interfaceObjectCollection<K>
- Specified by:
spliterator
in interfaceObjectIterable<K>
- Specified by:
spliterator
in interfaceObjectSet<K>
- Specified by:
spliterator
in interfaceSet<K>
- Specified by:
spliterator
in interfaceSortedSet<K>
- Returns:
- a type-specific spliterator on the elements of this collection.
- Since:
- 8.5.0
- API Notes:
- This specification strengthens the one given in
Collection.spliterator()
, which was already strengthened in the corresponding type-specific class, but was weakened by the fact that this interface extendsSortedSet
.Also, this is generally the only
spliterator
method subclasses should override. - Implementation Specification:
- The default implementation returns a late-binding spliterator (see
Spliterator
for documentation on what binding policies mean) that wraps this instance's type specificiterator(K)
.Additionally, it reports
Spliterator.SIZED
,Spliterator.DISTINCT
,Spliterator.SORTED
, andSpliterator.ORDERED
. The reportedComparator
fromSpliterator.getComparator()
will be the one reported by this instance'sSortedSet.comparator()
. - Implementation Notes:
- As this default implementation wraps the iterator, and
Iterator
is an inherently linear API, the returned spliterator will yield limited performance gains when run in parallel contexts, as the returned spliterator'strySplit()
will have linear runtime.
-
subSet
Returns a view of the portion of this sorted set whose elements range fromfromElement
, inclusive, totoElement
, exclusive.- Specified by:
subSet
in interfaceSortedSet<K>
- See Also:
- API Notes:
- This specification strengthens the one given in
SortedSet.subSet(Object,Object)
.
-
headSet
Returns a view of the portion of this sorted set whose elements are strictly less thantoElement
.- Specified by:
headSet
in interfaceSortedSet<K>
- See Also:
- API Notes:
- This specification strengthens the one given in
SortedSet.headSet(Object)
.
-
tailSet
Returns a view of the portion of this sorted set whose elements are greater than or equal tofromElement
.- Specified by:
tailSet
in interfaceSortedSet<K>
- See Also:
- API Notes:
- This specification strengthens the one given in
SortedSet.headSet(Object)
.
-