it.unimi.dsi.fastutil.objects
Interface ObjectSortedSet<K>

All Superinterfaces:
Collection<K>, Iterable<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>

A type-specific 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:
SortedSet

Method Summary
 ObjectSortedSet<K> headSet(K toElement)
          Returns a view of the portion of this sorted set whose elements are strictly less than toElement.
 ObjectBidirectionalIterator<K> iterator()
          Returns a type-specific BidirectionalIterator on the elements in this set.
 ObjectBidirectionalIterator<K> iterator(K fromElement)
          Returns a type-specific BidirectionalIterator on the elements in this set, starting from a given element of the domain (optional operation).
 ObjectBidirectionalIterator<K> objectIterator()
          Deprecated. As of fastutil 5, replaced by iterator().
 ObjectSortedSet<K> subSet(K fromElement, K toElement)
          Returns a view of the portion of this sorted set whose elements range from fromElement, inclusive, to toElement, exclusive.
 ObjectSortedSet<K> tailSet(K fromElement)
          Returns a view of the portion of this sorted set whose elements are greater than or equal to fromElement.
 
Methods inherited from interface it.unimi.dsi.fastutil.objects.ObjectSet
remove
 
Methods inherited from interface it.unimi.dsi.fastutil.objects.ObjectCollection
toArray
 
Methods inherited from interface java.util.SortedSet
comparator, first, last
 
Methods inherited from interface java.util.Set
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, size, toArray, toArray
 

Method Detail

iterator

ObjectBidirectionalIterator<K> iterator(K fromElement)
Returns a type-specific BidirectionalIterator 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 return false). 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 return false).

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.

objectIterator

@Deprecated
ObjectBidirectionalIterator<K> objectIterator()
Deprecated. As of fastutil 5, replaced by iterator().

Returns a type-specific BidirectionalIterator iterator on the collection.

The iterator returned by the iterator() method and by this method are identical; however, using this method you can save a type casting. Note that this specification strengthens the one given in the corresponding type-specific Collection.

Specified by:
objectIterator in interface ObjectCollection<K>
See Also:
ObjectCollection.iterator()

iterator

ObjectBidirectionalIterator<K> iterator()
Returns a type-specific BidirectionalIterator 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. Note that this specification strengthens the one given in the corresponding type-specific Collection.

Specified by:
iterator in interface Collection<K>
Specified by:
iterator in interface Iterable<K>
Specified by:
iterator in interface ObjectCollection<K>
Specified by:
iterator in interface ObjectIterable<K>
Specified by:
iterator in interface ObjectSet<K>
Specified by:
iterator in interface Set<K>
Returns:
a bidirectional iterator on the element in this set.

subSet

ObjectSortedSet<K> subSet(K fromElement,
                          K toElement)
Returns a view of the portion of this sorted set whose elements range from fromElement, inclusive, to toElement, exclusive.

Note that this specification strengthens the one given in SortedSet.subSet(Object,Object).

Specified by:
subSet in interface SortedSet<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 than toElement.

Note that this specification strengthens the one given in SortedSet.headSet(Object).

Specified by:
headSet in interface SortedSet<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 to fromElement.

Note that this specification strengthens the one given in SortedSet.tailSet(Object).

Specified by:
tailSet in interface SortedSet<K>
See Also:
SortedSet.tailSet(Object)