it.unimi.dsi.fastutil.shorts
Class Short2ReferenceSortedMaps.Singleton<V>

java.lang.Object
  extended by it.unimi.dsi.fastutil.shorts.AbstractShort2ReferenceFunction<V>
      extended by it.unimi.dsi.fastutil.shorts.Short2ReferenceFunctions.Singleton<V>
          extended by it.unimi.dsi.fastutil.shorts.Short2ReferenceMaps.Singleton<V>
              extended by it.unimi.dsi.fastutil.shorts.Short2ReferenceSortedMaps.Singleton<V>
All Implemented Interfaces:
Function<java.lang.Short,V>, Short2ReferenceFunction<V>, Short2ReferenceMap<V>, Short2ReferenceSortedMap<V>, java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.Short,V>, java.util.SortedMap<java.lang.Short,V>
Enclosing class:
Short2ReferenceSortedMaps

public static class Short2ReferenceSortedMaps.Singleton<V>
extends Short2ReferenceMaps.Singleton<V>
implements Short2ReferenceSortedMap<V>, java.io.Serializable, java.lang.Cloneable

An immutable class representing a type-specific singleton sorted map.

This class may be useful to implement your own in case you subclass a type-specific sorted map.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface it.unimi.dsi.fastutil.shorts.Short2ReferenceSortedMap
Short2ReferenceSortedMap.FastSortedEntrySet<V>
 
Nested classes/interfaces inherited from interface it.unimi.dsi.fastutil.shorts.Short2ReferenceMap
Short2ReferenceMap.Entry<V>, Short2ReferenceMap.FastEntrySet<V>
 
Method Summary
 ShortComparator comparator()
          Returns the comparator associated with this sorted set, or null if it uses its keys' natural ordering.
 ObjectSortedSet<java.util.Map.Entry<java.lang.Short,V>> entrySet()
          Returns a set view of the mappings contained in this map.
 java.lang.Short firstKey()
           
 short firstShortKey()
           
 Short2ReferenceSortedMap<V> headMap(short to)
          Returns a view of the portion of this sorted map whose keys are strictly less than toKey.
 Short2ReferenceSortedMap<V> headMap(java.lang.Short oto)
          Returns a view of the portion of this sorted map whose keys are strictly less than toKey.
 ShortSortedSet keySet()
          Returns a set view of the keys contained in this map.
 java.lang.Short lastKey()
           
 short lastShortKey()
           
 ObjectSortedSet<Short2ReferenceMap.Entry<V>> short2ReferenceEntrySet()
          Returns a type-specific set view of the mappings contained in this map.
 Short2ReferenceSortedMap<V> subMap(short from, short to)
          Returns a view of the portion of this sorted map whose keys range from fromKey, inclusive, to toKey, exclusive.
 Short2ReferenceSortedMap<V> subMap(java.lang.Short ofrom, java.lang.Short oto)
          Returns a view of the portion of this sorted map whose keys range from fromKey, inclusive, to toKey, exclusive.
 Short2ReferenceSortedMap<V> tailMap(short from)
          Returns a view of the portion of this sorted map whose keys are greater than or equal to fromKey.
 Short2ReferenceSortedMap<V> tailMap(java.lang.Short ofrom)
          Returns a view of the portion of this sorted map whose keys are greater than or equal to fromKey.
 
Methods inherited from class it.unimi.dsi.fastutil.shorts.Short2ReferenceMaps.Singleton
containsValue, equals, hashCode, isEmpty, putAll, toString, values
 
Methods inherited from class it.unimi.dsi.fastutil.shorts.Short2ReferenceFunctions.Singleton
clone, containsKey, get, size
 
Methods inherited from class it.unimi.dsi.fastutil.shorts.AbstractShort2ReferenceFunction
clear, containsKey, defaultReturnValue, defaultReturnValue, get, put, put, remove, remove
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface it.unimi.dsi.fastutil.shorts.Short2ReferenceSortedMap
values
 
Methods inherited from interface it.unimi.dsi.fastutil.shorts.Short2ReferenceFunction
containsKey, defaultReturnValue, defaultReturnValue, get, put, remove
 
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
 

Method Detail

comparator

public ShortComparator comparator()
Description copied from interface: Short2ReferenceSortedMap
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 Short2ReferenceSortedMap<V>
Specified by:
comparator in interface java.util.SortedMap<java.lang.Short,V>
See Also:
SortedMap.comparator()

short2ReferenceEntrySet

public ObjectSortedSet<Short2ReferenceMap.Entry<V>> short2ReferenceEntrySet()
Description copied from interface: Short2ReferenceMap
Returns a type-specific set view of the mappings contained in this map.

This method is necessary because there is no inheritance along type parameters: it is thus impossible to strengthen Short2ReferenceMap.entrySet() so that it returns an ObjectSet of objects of type Map.Entry (the latter makes it possible to access keys and values with type-specific methods).

Specified by:
short2ReferenceEntrySet in interface Short2ReferenceMap<V>
Specified by:
short2ReferenceEntrySet in interface Short2ReferenceSortedMap<V>
Overrides:
short2ReferenceEntrySet in class Short2ReferenceMaps.Singleton<V>
Returns:
a type-specific set view of the mappings contained in this map.
See Also:
Short2ReferenceMap.entrySet()

entrySet

public ObjectSortedSet<java.util.Map.Entry<java.lang.Short,V>> entrySet()
Description copied from interface: Short2ReferenceMap
Returns a set view of the mappings contained in this map.

Note that this specification strengthens the one given in Map.entrySet().

Specified by:
entrySet in interface Short2ReferenceMap<V>
Specified by:
entrySet in interface Short2ReferenceSortedMap<V>
Specified by:
entrySet in interface java.util.Map<java.lang.Short,V>
Specified by:
entrySet in interface java.util.SortedMap<java.lang.Short,V>
Overrides:
entrySet in class Short2ReferenceMaps.Singleton<V>
Returns:
a set view of the mappings contained in this map.
See Also:
Map.entrySet()

keySet

public ShortSortedSet keySet()
Description copied from interface: Short2ReferenceMap
Returns a set view of the keys contained in this map.

Note that this specification strengthens the one given in Map.keySet().

Specified by:
keySet in interface Short2ReferenceMap<V>
Specified by:
keySet in interface Short2ReferenceSortedMap<V>
Specified by:
keySet in interface java.util.Map<java.lang.Short,V>
Specified by:
keySet in interface java.util.SortedMap<java.lang.Short,V>
Overrides:
keySet in class Short2ReferenceMaps.Singleton<V>
Returns:
a set view of the keys contained in this map.
See Also:
Map.keySet()

subMap

public Short2ReferenceSortedMap<V> subMap(short from,
                                          short to)
Description copied from interface: Short2ReferenceSortedMap
Returns a view of the portion of this sorted map whose keys range from fromKey, inclusive, to toKey, exclusive.

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

headMap

public Short2ReferenceSortedMap<V> headMap(short to)
Description copied from interface: Short2ReferenceSortedMap
Returns a view of the portion of this sorted map whose keys are strictly less than toKey.

Specified by:
headMap in interface Short2ReferenceSortedMap<V>
See Also:
SortedMap.headMap(Object)

tailMap

public Short2ReferenceSortedMap<V> tailMap(short from)
Description copied from interface: Short2ReferenceSortedMap
Returns a view of the portion of this sorted map whose keys are greater than or equal to fromKey.

Specified by:
tailMap in interface Short2ReferenceSortedMap<V>
See Also:
SortedMap.tailMap(Object)

firstShortKey

public short firstShortKey()
Specified by:
firstShortKey in interface Short2ReferenceSortedMap<V>
See Also:
SortedMap.firstKey()

lastShortKey

public short lastShortKey()
Specified by:
lastShortKey in interface Short2ReferenceSortedMap<V>
See Also:
SortedMap.lastKey()

headMap

public Short2ReferenceSortedMap<V> headMap(java.lang.Short oto)
Description copied from interface: Short2ReferenceSortedMap
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 Short2ReferenceSortedMap<V>
Specified by:
headMap in interface java.util.SortedMap<java.lang.Short,V>
See Also:
SortedMap.headMap(Object)

tailMap

public Short2ReferenceSortedMap<V> tailMap(java.lang.Short ofrom)
Description copied from interface: Short2ReferenceSortedMap
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 Short2ReferenceSortedMap<V>
Specified by:
tailMap in interface java.util.SortedMap<java.lang.Short,V>
See Also:
SortedMap.tailMap(Object)

subMap

public Short2ReferenceSortedMap<V> subMap(java.lang.Short ofrom,
                                          java.lang.Short oto)
Description copied from interface: Short2ReferenceSortedMap
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 Short2ReferenceSortedMap<V>
Specified by:
subMap in interface java.util.SortedMap<java.lang.Short,V>
See Also:
SortedMap.subMap(Object,Object)

firstKey

public java.lang.Short firstKey()
Specified by:
firstKey in interface java.util.SortedMap<java.lang.Short,V>

lastKey

public java.lang.Short lastKey()
Specified by:
lastKey in interface java.util.SortedMap<java.lang.Short,V>