it.unimi.dsi.fastutil.objects
Interface Reference2ObjectSortedMap<K,V>

All Superinterfaces:
Function<K,V>, java.util.Map<K,V>, Reference2ObjectFunction<K,V>, Reference2ObjectMap<K,V>, java.util.SortedMap<K,V>
All Known Implementing Classes:
AbstractReference2ObjectSortedMap, Reference2ObjectLinkedOpenHashMap, Reference2ObjectSortedMaps.EmptySortedMap, Reference2ObjectSortedMaps.Singleton, Reference2ObjectSortedMaps.SynchronizedSortedMap, Reference2ObjectSortedMaps.UnmodifiableSortedMap

public interface Reference2ObjectSortedMap<K,V>
extends Reference2ObjectMap<K,V>, java.util.SortedMap<K,V>

A type-specific SortedMap; provides some additional methods that use polymorphism to avoid (un)boxing.

Additionally, this interface strengthens entrySet(), keySet(), values(), comparator(), SortedMap.subMap(Object,Object), SortedMap.headMap(Object) and SortedMap.tailMap(Object).

See Also:
SortedMap

Nested Class Summary
static interface Reference2ObjectSortedMap.FastSortedEntrySet<K,V>
          A sorted entry set providing fast iteration.
 
Nested classes/interfaces inherited from interface it.unimi.dsi.fastutil.objects.Reference2ObjectMap
Reference2ObjectMap.Entry<K,V>, Reference2ObjectMap.FastEntrySet<K,V>
 
Method Summary
 java.util.Comparator<? super K> comparator()
          Returns the comparator associated with this sorted set, or null if it uses its keys' natural ordering.
 ObjectSortedSet<java.util.Map.Entry<K,V>> entrySet()
          Returns a sorted-set view of the mappings contained in this map.
 Reference2ObjectSortedMap<K,V> headMap(K toKey)
          Returns a view of the portion of this sorted map whose keys are strictly less than toKey.
 ReferenceSortedSet<K> keySet()
          Returns a sorted-set view of the keys contained in this map.
 ObjectSortedSet<Reference2ObjectMap.Entry<K,V>> reference2ObjectEntrySet()
          Returns a type-specific sorted-set view of the mappings contained in this map.
 Reference2ObjectSortedMap<K,V> subMap(K fromKey, K toKey)
          Returns a view of the portion of this sorted map whose keys range from fromKey, inclusive, to toKey, exclusive.
 Reference2ObjectSortedMap<K,V> tailMap(K fromKey)
          Returns a view of the portion of this sorted map whose keys are greater than or equal to fromKey.
 ObjectCollection<V> values()
          Returns a set view of the values contained in this map.
 
Methods inherited from interface it.unimi.dsi.fastutil.objects.Reference2ObjectFunction
defaultReturnValue, defaultReturnValue
 
Methods inherited from interface it.unimi.dsi.fastutil.Function
clear, containsKey, get, put, remove, size
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, equals, get, hashCode, isEmpty, put, putAll, remove, size
 
Methods inherited from interface java.util.SortedMap
firstKey, lastKey
 
Methods inherited from interface java.util.Map
clear, containsKey, containsValue, equals, get, hashCode, isEmpty, put, putAll, remove, size
 

Method Detail

entrySet

ObjectSortedSet<java.util.Map.Entry<K,V>> entrySet()
Returns a sorted-set view of the mappings contained in this map. Note that this specification strengthens the one given in the corresponding type-specific unsorted map.

Specified by:
entrySet in interface java.util.Map<K,V>
Specified by:
entrySet in interface Reference2ObjectMap<K,V>
Returns:
a sorted-set view of the mappings contained in this map.
See Also:
Map.entrySet()

reference2ObjectEntrySet

ObjectSortedSet<Reference2ObjectMap.Entry<K,V>> reference2ObjectEntrySet()
Returns a type-specific sorted-set view of the mappings contained in this map. Note that this specification strengthens the one given in the corresponding type-specific unsorted map.

Specified by:
reference2ObjectEntrySet in interface Reference2ObjectMap<K,V>
Returns:
a type-specific sorted-set view of the mappings contained in this map.
See Also:
entrySet()

keySet

ReferenceSortedSet<K> keySet()
Returns a sorted-set view of the keys contained in this map. Note that this specification strengthens the one given in the corresponding type-specific unsorted map.

Specified by:
keySet in interface java.util.Map<K,V>
Specified by:
keySet in interface Reference2ObjectMap<K,V>
Returns:
a sorted-set view of the keys contained in this map.
See Also:
Map.keySet()

values

ObjectCollection<V> values()
Returns a set view of the values contained in this map.

Note that this specification strengthens the one given in Map.values(), which was already strengthened in the corresponding type-specific class, but was weakened by the fact that this interface extends SortedMap.

Specified by:
values in interface java.util.Map<K,V>
Specified by:
values in interface Reference2ObjectMap<K,V>
Returns:
a set view of the values contained in this map.
See Also:
Map.values()

comparator

java.util.Comparator<? super K> comparator()
Returns the comparator associated with this sorted set, or null if it uses its keys' natural ordering.

Note that this specification strengthens the one given in SortedMap.comparator().

Specified by:
comparator in interface java.util.SortedMap<K,V>
See Also:
SortedMap.comparator()

subMap

Reference2ObjectSortedMap<K,V> subMap(K fromKey,
                                      K toKey)
Returns a view of the portion of this sorted map whose keys range from fromKey, inclusive, to toKey, exclusive.

Note that this specification strengthens the one given in SortedMap.subMap(Object,Object).

Specified by:
subMap in interface java.util.SortedMap<K,V>
See Also:
SortedMap.subMap(Object,Object)

headMap

Reference2ObjectSortedMap<K,V> headMap(K toKey)
Returns a view of the portion of this sorted map whose keys are strictly less than toKey.

Note that this specification strengthens the one given in SortedMap.headMap(Object).

Specified by:
headMap in interface java.util.SortedMap<K,V>
See Also:
SortedMap.headMap(Object)

tailMap

Reference2ObjectSortedMap<K,V> tailMap(K fromKey)
Returns a view of the portion of this sorted map whose keys are greater than or equal to fromKey.

Note that this specification strengthens the one given in SortedMap.tailMap(Object).

Specified by:
tailMap in interface java.util.SortedMap<K,V>
See Also:
SortedMap.tailMap(Object)