Interface ObjectSortedSet<K>
-
- All Superinterfaces:
Collection<K>,Iterable<K>,ObjectBidirectionalIterable<K>,ObjectCollection<K>,ObjectIterable<K>,ObjectSet<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
public interface ObjectSortedSet<K> extends ObjectSet<K>, SortedSet<K>, ObjectBidirectionalIterable<K>
A type-specificSortedSet; 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)andSortedSet.tailSet(Object).- See Also:
SortedSet
-
-
Method Summary
Modifier and Type Method Description ObjectSortedSet<K>headSet(K toElement)Returns a view of the portion of this sorted set whose elements are strictly less thantoElement.ObjectBidirectionalIterator<K>iterator()Returns a type-specificBidirectionalIteratoron the elements in this set.ObjectBidirectionalIterator<K>iterator(K fromElement)Returns a type-specificBidirectionalIteratoron the elements in this set, starting from a given element of the domain (optional operation).ObjectSortedSet<K>subSet(K fromElement, K toElement)Returns a view of the portion of this sorted set whose elements range fromfromElement, inclusive, totoElement, exclusive.ObjectSortedSet<K>tailSet(K fromElement)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
comparator, first, last, spliterator
-
-
-
-
Method Detail
-
iterator
ObjectBidirectionalIterator<K> iterator(K fromElement)
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
ObjectBidirectionalIterator<K> iterator()
Returns a type-specificBidirectionalIteratoron the elements in this set.Note that this specification strengthens the one given in the corresponding type-specific
Collection.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 interfaceObjectBidirectionalIterable<K>- Specified by:
iteratorin interfaceObjectCollection<K>- Specified by:
iteratorin interfaceObjectIterable<K>- Specified by:
iteratorin interfaceObjectSet<K>- Specified by:
iteratorin interfaceSet<K>- Returns:
- a bidirectional iterator on the element in this set.
- See Also:
Iterable.iterator()
-
subSet
ObjectSortedSet<K> subSet(K fromElement, K toElement)
Returns a view of the portion of this sorted set whose elements range fromfromElement, inclusive, totoElement, exclusive.Note that this specification strengthens the one given in
SortedSet.subSet(Object,Object).- Specified by:
subSetin interfaceSortedSet<K>- See Also:
SortedSet.subSet(Object,Object)
-
headSet
ObjectSortedSet<K> headSet(K toElement)
Returns a view of the portion of this sorted set whose elements are strictly less thantoElement.Note that this specification strengthens the one given in
SortedSet.headSet(Object).- Specified by:
headSetin interfaceSortedSet<K>- See Also:
SortedSet.headSet(Object)
-
tailSet
ObjectSortedSet<K> tailSet(K fromElement)
Returns a view of the portion of this sorted set whose elements are greater than or equal tofromElement.Note that this specification strengthens the one given in
SortedSet.headSet(Object).- Specified by:
tailSetin interfaceSortedSet<K>- See Also:
SortedSet.tailSet(Object)
-
-