Class ImmutableSortedMap<K,V>
- java.lang.Object
- 
- com.google.common.collect.ImmutableMap<K,V>
- 
- com.google.common.collect.ImmutableSortedMap<K,V>
 
 
- 
- All Implemented Interfaces:
- Serializable,- Map<K,V>,- NavigableMap<K,V>,- SortedMap<K,V>
 
 @GwtCompatible(serializable=true, emulated=true) public final class ImmutableSortedMap<K,V> extends ImmutableMap<K,V> implements NavigableMap<K,V> ANavigableMapwhose contents will never change, with many other important properties detailed atImmutableCollection.Warning: as with any sorted collection, you are strongly advised not to use a ComparatororComparabletype whose comparison behavior is inconsistent with equals. That is,a.compareTo(b)orcomparator.compare(a, b)should equal zero if and only ifa.equals(b). If this advice is not followed, the resulting map will not correctly obey its specification.See the Guava User Guide article on immutable collections. - Since:
- 2.0 (implements NavigableMapsince 12.0)
- Author:
- Jared Levy, Louis Wasserman
- See Also:
- Serialized Form
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classImmutableSortedMap.Builder<K,V>A builder for creating immutable sorted map instances, especiallypublic static finalmaps ("constant maps").
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static <K,V>
 ImmutableSortedMap.Builder<K,V>builder()Deprecated.UsenaturalOrder(), which offers better type-safety.static <K,V>
 ImmutableSortedMap.Builder<K,V>builderWithExpectedSize(int expectedSize)Deprecated.Not supported for ImmutableSortedMap.Map.Entry<K,V>ceilingEntry(K key)Returns a key-value mapping associated with the least key greater than or equal to the given key, ornullif there is no such key.KceilingKey(K key)Returns the least key greater than or equal to the given key, ornullif there is no such key.Comparator<? super K>comparator()Returns the comparator that orders the keys, which isOrdering.natural()when the natural ordering of the keys is used.static <K,V>
 ImmutableSortedMap<K,V>copyOf(Iterable<? extends Map.Entry<? extends K,? extends V>> entries)Returns an immutable map containing the given entries, with keys sorted by their natural ordering.static <K,V>
 ImmutableSortedMap<K,V>copyOf(Iterable<? extends Map.Entry<? extends K,? extends V>> entries, Comparator<? super K> comparator)Returns an immutable map containing the given entries, with keys sorted by the provided comparator.static <K,V>
 ImmutableSortedMap<K,V>copyOf(Map<? extends K,? extends V> map)Returns an immutable map containing the same entries asmap, sorted by the natural ordering of the keys.static <K,V>
 ImmutableSortedMap<K,V>copyOf(Map<? extends K,? extends V> map, Comparator<? super K> comparator)Returns an immutable map containing the same entries asmap, with keys sorted by the provided comparator.static <K,V>
 ImmutableSortedMap<K,V>copyOfSorted(SortedMap<K,? extends V> map)Returns an immutable map containing the same entries as the provided sorted map, with the same ordering.ImmutableSortedSet<K>descendingKeySet()Returns a reverse orderNavigableSetview of the keys contained in this map.ImmutableSortedMap<K,V>descendingMap()Returns a reverse order view of the mappings contained in this map.ImmutableSet<Map.Entry<K,V>>entrySet()Returns an immutable set of the mappings in this map, sorted by the key ordering.Map.Entry<K,V>firstEntry()Returns a key-value mapping associated with the least key in this map, ornullif the map is empty.KfirstKey()Returns the first (lowest) key currently in this map.Map.Entry<K,V>floorEntry(K key)Returns a key-value mapping associated with the greatest key less than or equal to the given key, ornullif there is no such key.KfloorKey(K key)Returns the greatest key less than or equal to the given key, ornullif there is no such key.voidforEach(BiConsumer<? super K,? super V> action)Performs the given action for each entry in this map until all entries have been processed or the action throws an exception.Vget(Object key)Returns the value to which the specified key is mapped, ornullif this map contains no mapping for the key.ImmutableSortedMap<K,V>headMap(K toKey)This method returns aImmutableSortedMap, consisting of the entries whose keys are less thantoKey.ImmutableSortedMap<K,V>headMap(K toKey, boolean inclusive)This method returns aImmutableSortedMap, consisting of the entries whose keys are less than (or equal to, ifinclusive)toKey.Map.Entry<K,V>higherEntry(K key)Returns a key-value mapping associated with the least key strictly greater than the given key, ornullif there is no such key.KhigherKey(K key)Returns the least key strictly greater than the given key, ornullif there is no such key.ImmutableSortedSet<K>keySet()Returns an immutable sorted set of the keys in this map.Map.Entry<K,V>lastEntry()Returns a key-value mapping associated with the greatest key in this map, ornullif the map is empty.KlastKey()Returns the last (highest) key currently in this map.Map.Entry<K,V>lowerEntry(K key)Returns a key-value mapping associated with the greatest key strictly less than the given key, ornullif there is no such key.KlowerKey(K key)Returns the greatest key strictly less than the given key, ornullif there is no such key.static <K extends Comparable<?>,V>
 ImmutableSortedMap.Builder<K,V>naturalOrder()Returns a builder that creates immutable sorted maps whose keys are ordered by their natural ordering.ImmutableSortedSet<K>navigableKeySet()Returns aNavigableSetview of the keys contained in this map.static <K,V>
 ImmutableSortedMap<K,V>of()Returns the empty sorted map.static <K extends Comparable<? super K>,V>
 ImmutableSortedMap<K,V>of(K k1, V v1)Returns an immutable map containing a single entry.static <K,V>
 ImmutableSortedMap<K,V>of(K k1, V v1)Deprecated.Pass a key of typeComparableto useof(Comparable, Object).static <K extends Comparable<? super K>,V>
 ImmutableSortedMap<K,V>of(K k1, V v1, K k2, V v2)Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.static <K,V>
 ImmutableSortedMap<K,V>of(K k1, V v1, K k2, V v2)Deprecated.Pass keys of typeComparableto useof(Comparable, Object, Comparable, Object).static <K extends Comparable<? super K>,V>
 ImmutableSortedMap<K,V>of(K k1, V v1, K k2, V v2, K k3, V v3)Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.static <K,V>
 ImmutableSortedMap<K,V>of(K k1, V v1, K k2, V v2, K k3, V v3)Deprecated.Pass keys of typeComparableto useof(Comparable, Object, Comparable, Object, Comparable, Object).static <K extends Comparable<? super K>,V>
 ImmutableSortedMap<K,V>of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.static <K,V>
 ImmutableSortedMap<K,V>of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4)Deprecated.Pass keys of typeComparableto useof(Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object).static <K extends Comparable<? super K>,V>
 ImmutableSortedMap<K,V>of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5)Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.static <K,V>
 ImmutableSortedMap<K,V>of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5)Deprecated.Pass keys of typeComparableto useof(Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object).static <K extends Comparable<? super K>,V>
 ImmutableSortedMap<K,V>of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6)Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.static <K,V>
 ImmutableSortedMap<K,V>of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6)Deprecated.Pass keys of typeComparableto useof(Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object).static <K extends Comparable<? super K>,V>
 ImmutableSortedMap<K,V>of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7)Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.static <K,V>
 ImmutableSortedMap<K,V>of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7)Deprecated.Pass keys of typeComparableto useof(Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object).static <K extends Comparable<? super K>,V>
 ImmutableSortedMap<K,V>of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8)Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.static <K,V>
 ImmutableSortedMap<K,V>of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8)Deprecated.Pass keys of typeComparableto useof(Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object).static <K extends Comparable<? super K>,V>
 ImmutableSortedMap<K,V>of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9)Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.static <K,V>
 ImmutableSortedMap<K,V>of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9)Deprecated.Pass keys of typeComparableto useof(Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object).static <K extends Comparable<? super K>,V>
 ImmutableSortedMap<K,V>of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9, K k10, V v10)Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.static <K,V>
 ImmutableSortedMap<K,V>of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9, K k10, V v10)Deprecated.Pass keys of typeComparableto useof(Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object).static <K,V>
 ImmutableSortedMap<K,V>ofEntries(Map.Entry<? extends K,? extends V>... entries)Deprecated.UseImmutableSortedMap.copyOf(ImmutableMap.ofEntries(...)).static <K,V>
 ImmutableSortedMap.Builder<K,V>orderedBy(Comparator<K> comparator)Returns a builder that creates immutable sorted maps with an explicit comparator.Map.Entry<K,V>pollFirstEntry()Deprecated.Unsupported operation.Map.Entry<K,V>pollLastEntry()Deprecated.Unsupported operation.static <K extends Comparable<?>,V>
 ImmutableSortedMap.Builder<K,V>reverseOrder()Returns a builder that creates immutable sorted maps whose keys are ordered by the reverse of their natural ordering.intsize()Returns the number of key-value mappings in this map.ImmutableSortedMap<K,V>subMap(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive)This method returns aImmutableSortedMap, consisting of the entries whose keys ranges fromfromKeytotoKey, inclusive or exclusive as indicated by the boolean flags.ImmutableSortedMap<K,V>subMap(K fromKey, K toKey)This method returns aImmutableSortedMap, consisting of the entries whose keys ranges fromfromKey, inclusive, totoKey, exclusive.ImmutableSortedMap<K,V>tailMap(K fromKey)This method returns aImmutableSortedMap, consisting of the entries whose keys are greater than or equals tofromKey.ImmutableSortedMap<K,V>tailMap(K fromKey, boolean inclusive)This method returns aImmutableSortedMap, consisting of the entries whose keys are greater than (or equal to, ifinclusive)fromKey.static <T extends @Nullable Object,K,V>
 Collector<T,?,ImmutableMap<K,V>>toImmutableMap(Function<? super T,? extends K> keyFunction, Function<? super T,? extends V> valueFunction)static <T extends @Nullable Object,K,V>
 Collector<T,?,ImmutableMap<K,V>>toImmutableMap(Function<? super T,? extends K> keyFunction, Function<? super T,? extends V> valueFunction, BinaryOperator<V> mergeFunction)static <T extends @Nullable Object,K,V>
 Collector<T,?,ImmutableSortedMap<K,V>>toImmutableSortedMap(Comparator<? super K> comparator, Function<? super T,? extends K> keyFunction, Function<? super T,? extends V> valueFunction)Returns aCollectorthat accumulates elements into anImmutableSortedMapwhose keys and values are the result of applying the provided mapping functions to the input elements.static <T extends @Nullable Object,K,V>
 Collector<T,?,ImmutableSortedMap<K,V>>toImmutableSortedMap(Comparator<? super K> comparator, Function<? super T,? extends K> keyFunction, Function<? super T,? extends V> valueFunction, BinaryOperator<V> mergeFunction)Returns aCollectorthat accumulates elements into anImmutableSortedMapwhose keys and values are the result of applying the provided mapping functions to the input elements.ImmutableCollection<V>values()Returns an immutable collection of the values in this map, sorted by the ordering of the corresponding keys.- 
Methods inherited from class com.google.common.collect.ImmutableMapasMultimap, clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, equals, getOrDefault, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, toString
 - 
Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface java.util.Mapclear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, equals, getOrDefault, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll
 
- 
 
- 
- 
- 
Method Detail- 
toImmutableSortedMappublic static <T extends @Nullable Object,K,V> Collector<T,?,ImmutableSortedMap<K,V>> toImmutableSortedMap(Comparator<? super K> comparator, Function<? super T,? extends K> keyFunction, Function<? super T,? extends V> valueFunction) Returns aCollectorthat accumulates elements into anImmutableSortedMapwhose keys and values are the result of applying the provided mapping functions to the input elements. The generated map is sorted by the specified comparator.If the mapped keys contain duplicates (according to the specified comparator), an IllegalArgumentExceptionis thrown when the collection operation is performed. (This differs from theCollectorreturned byCollectors.toMap(Function, Function), which throws anIllegalStateException.)- Since:
- 21.0
 
 - 
toImmutableSortedMappublic static <T extends @Nullable Object,K,V> Collector<T,?,ImmutableSortedMap<K,V>> toImmutableSortedMap(Comparator<? super K> comparator, Function<? super T,? extends K> keyFunction, Function<? super T,? extends V> valueFunction, BinaryOperator<V> mergeFunction) Returns aCollectorthat accumulates elements into anImmutableSortedMapwhose keys and values are the result of applying the provided mapping functions to the input elements.If the mapped keys contain duplicates (according to the comparator), the the values are merged using the specified merging function. Entries will appear in the encounter order of the first occurrence of the key. - Since:
- 21.0
 
 - 
ofpublic static <K,V> ImmutableSortedMap<K,V> of() Returns the empty sorted map.Performance note: the instance returned is a singleton. - Type Parameters:
- K- the- Map's key type
- V- the- Map's value type
- Returns:
- an empty Map
 
 - 
ofpublic static <K extends Comparable<? super K>,V> ImmutableSortedMap<K,V> of(K k1, V v1) Returns an immutable map containing a single entry.- Type Parameters:
- K- the- Map's key type
- V- the- Map's value type
- Parameters:
- k1- the mapping's key
- v1- the mapping's value
- Returns:
- a Mapcontaining the specified mapping
 
 - 
ofpublic static <K extends Comparable<? super K>,V> ImmutableSortedMap<K,V> of(K k1, V v1, K k2, V v2) Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.- Type Parameters:
- K- the- Map's key type
- V- the- Map's value type
- Parameters:
- k1- the first mapping's key
- v1- the first mapping's value
- k2- the second mapping's key
- v2- the second mapping's value
- Returns:
- a Mapcontaining the specified mappings
- Throws:
- IllegalArgumentException- if the two keys are equal according to their natural ordering
 
 - 
ofpublic static <K extends Comparable<? super K>,V> ImmutableSortedMap<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3) Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.- Type Parameters:
- K- the- Map's key type
- V- the- Map's value type
- Parameters:
- k1- the first mapping's key
- v1- the first mapping's value
- k2- the second mapping's key
- v2- the second mapping's value
- k3- the third mapping's key
- v3- the third mapping's value
- Returns:
- a Mapcontaining the specified mappings
- Throws:
- IllegalArgumentException- if any two keys are equal according to their natural ordering
 
 - 
ofpublic static <K extends Comparable<? super K>,V> ImmutableSortedMap<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4) Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.- Type Parameters:
- K- the- Map's key type
- V- the- Map's value type
- Parameters:
- k1- the first mapping's key
- v1- the first mapping's value
- k2- the second mapping's key
- v2- the second mapping's value
- k3- the third mapping's key
- v3- the third mapping's value
- k4- the fourth mapping's key
- v4- the fourth mapping's value
- Returns:
- a Mapcontaining the specified mappings
- Throws:
- IllegalArgumentException- if any two keys are equal according to their natural ordering
 
 - 
ofpublic static <K extends Comparable<? super K>,V> ImmutableSortedMap<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5) Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.- Type Parameters:
- K- the- Map's key type
- V- the- Map's value type
- Parameters:
- k1- the first mapping's key
- v1- the first mapping's value
- k2- the second mapping's key
- v2- the second mapping's value
- k3- the third mapping's key
- v3- the third mapping's value
- k4- the fourth mapping's key
- v4- the fourth mapping's value
- k5- the fifth mapping's key
- v5- the fifth mapping's value
- Returns:
- a Mapcontaining the specified mappings
- Throws:
- IllegalArgumentException- if any two keys are equal according to their natural ordering
 
 - 
ofpublic static <K extends Comparable<? super K>,V> ImmutableSortedMap<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6) Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.- Type Parameters:
- K- the- Map's key type
- V- the- Map's value type
- Parameters:
- k1- the first mapping's key
- v1- the first mapping's value
- k2- the second mapping's key
- v2- the second mapping's value
- k3- the third mapping's key
- v3- the third mapping's value
- k4- the fourth mapping's key
- v4- the fourth mapping's value
- k5- the fifth mapping's key
- v5- the fifth mapping's value
- k6- the sixth mapping's key
- v6- the sixth mapping's value
- Returns:
- a Mapcontaining the specified mappings
- Throws:
- IllegalArgumentException- if any two keys are equal according to their natural ordering
- Since:
- 31.0
 
 - 
ofpublic static <K extends Comparable<? super K>,V> ImmutableSortedMap<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7) Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.- Type Parameters:
- K- the- Map's key type
- V- the- Map's value type
- Parameters:
- k1- the first mapping's key
- v1- the first mapping's value
- k2- the second mapping's key
- v2- the second mapping's value
- k3- the third mapping's key
- v3- the third mapping's value
- k4- the fourth mapping's key
- v4- the fourth mapping's value
- k5- the fifth mapping's key
- v5- the fifth mapping's value
- k6- the sixth mapping's key
- v6- the sixth mapping's value
- k7- the seventh mapping's key
- v7- the seventh mapping's value
- Returns:
- a Mapcontaining the specified mappings
- Throws:
- IllegalArgumentException- if any two keys are equal according to their natural ordering
- Since:
- 31.0
 
 - 
ofpublic static <K extends Comparable<? super K>,V> ImmutableSortedMap<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8) Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.- Type Parameters:
- K- the- Map's key type
- V- the- Map's value type
- Parameters:
- k1- the first mapping's key
- v1- the first mapping's value
- k2- the second mapping's key
- v2- the second mapping's value
- k3- the third mapping's key
- v3- the third mapping's value
- k4- the fourth mapping's key
- v4- the fourth mapping's value
- k5- the fifth mapping's key
- v5- the fifth mapping's value
- k6- the sixth mapping's key
- v6- the sixth mapping's value
- k7- the seventh mapping's key
- v7- the seventh mapping's value
- k8- the eighth mapping's key
- v8- the eighth mapping's value
- Returns:
- a Mapcontaining the specified mappings
- Throws:
- IllegalArgumentException- if any two keys are equal according to their natural ordering
- Since:
- 31.0
 
 - 
ofpublic static <K extends Comparable<? super K>,V> ImmutableSortedMap<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9) Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.- Type Parameters:
- K- the- Map's key type
- V- the- Map's value type
- Parameters:
- k1- the first mapping's key
- v1- the first mapping's value
- k2- the second mapping's key
- v2- the second mapping's value
- k3- the third mapping's key
- v3- the third mapping's value
- k4- the fourth mapping's key
- v4- the fourth mapping's value
- k5- the fifth mapping's key
- v5- the fifth mapping's value
- k6- the sixth mapping's key
- v6- the sixth mapping's value
- k7- the seventh mapping's key
- v7- the seventh mapping's value
- k8- the eighth mapping's key
- v8- the eighth mapping's value
- k9- the ninth mapping's key
- v9- the ninth mapping's value
- Returns:
- a Mapcontaining the specified mappings
- Throws:
- IllegalArgumentException- if any two keys are equal according to their natural ordering
- Since:
- 31.0
 
 - 
ofpublic static <K extends Comparable<? super K>,V> ImmutableSortedMap<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9, K k10, V v10) Returns an immutable sorted map containing the given entries, sorted by the natural ordering of their keys.- Type Parameters:
- K- the- Map's key type
- V- the- Map's value type
- Parameters:
- k1- the first mapping's key
- v1- the first mapping's value
- k2- the second mapping's key
- v2- the second mapping's value
- k3- the third mapping's key
- v3- the third mapping's value
- k4- the fourth mapping's key
- v4- the fourth mapping's value
- k5- the fifth mapping's key
- v5- the fifth mapping's value
- k6- the sixth mapping's key
- v6- the sixth mapping's value
- k7- the seventh mapping's key
- v7- the seventh mapping's value
- k8- the eighth mapping's key
- v8- the eighth mapping's value
- k9- the ninth mapping's key
- v9- the ninth mapping's value
- k10- the tenth mapping's key
- v10- the tenth mapping's value
- Returns:
- a Mapcontaining the specified mappings
- Throws:
- IllegalArgumentException- if any two keys are equal according to their natural ordering
- Since:
- 31.0
 
 - 
copyOfpublic static <K,V> ImmutableSortedMap<K,V> copyOf(Map<? extends K,? extends V> map) Returns an immutable map containing the same entries asmap, sorted by the natural ordering of the keys.Despite the method name, this method attempts to avoid actually copying the data when it is safe to do so. The exact circumstances under which a copy will or will not be performed are undocumented and subject to change. This method is not type-safe, as it may be called on a map with keys that are not mutually comparable. - Type Parameters:
- K- the- Map's key type
- V- the- Map's value type
- Parameters:
- map- a- Mapfrom which entries are drawn, must be non-null
- Returns:
- a Mapcontaining the entries of the givenMap
- Throws:
- ClassCastException- if the keys in- mapare not mutually comparable
- NullPointerException- if any key or value in- mapis null
- IllegalArgumentException- if any two keys are equal according to their natural ordering
 
 - 
copyOfpublic static <K,V> ImmutableSortedMap<K,V> copyOf(Map<? extends K,? extends V> map, Comparator<? super K> comparator) Returns an immutable map containing the same entries asmap, with keys sorted by the provided comparator.Despite the method name, this method attempts to avoid actually copying the data when it is safe to do so. The exact circumstances under which a copy will or will not be performed are undocumented and subject to change. - Throws:
- NullPointerException- if any key or value in- mapis null
- IllegalArgumentException- if any two keys are equal according to the comparator
 
 - 
copyOf@Beta public static <K,V> ImmutableSortedMap<K,V> copyOf(Iterable<? extends Map.Entry<? extends K,? extends V>> entries) Returns an immutable map containing the given entries, with keys sorted by their natural ordering.This method is not type-safe, as it may be called on a map with keys that are not mutually comparable. - Throws:
- NullPointerException- if any key or value in- mapis null
- IllegalArgumentException- if any two keys are equal according to the comparator
- Since:
- 19.0
 
 - 
copyOf@Beta public static <K,V> ImmutableSortedMap<K,V> copyOf(Iterable<? extends Map.Entry<? extends K,? extends V>> entries, Comparator<? super K> comparator) Returns an immutable map containing the given entries, with keys sorted by the provided comparator.- Throws:
- NullPointerException- if any key or value in- mapis null
- IllegalArgumentException- if any two keys are equal according to the comparator
- Since:
- 19.0
 
 - 
copyOfSortedpublic static <K,V> ImmutableSortedMap<K,V> copyOfSorted(SortedMap<K,? extends V> map) Returns an immutable map containing the same entries as the provided sorted map, with the same ordering.Despite the method name, this method attempts to avoid actually copying the data when it is safe to do so. The exact circumstances under which a copy will or will not be performed are undocumented and subject to change. - Throws:
- NullPointerException- if any key or value in- mapis null
 
 - 
naturalOrderpublic static <K extends Comparable<?>,V> ImmutableSortedMap.Builder<K,V> naturalOrder() Returns a builder that creates immutable sorted maps whose keys are ordered by their natural ordering. The sorted maps useOrdering.natural()as the comparator.
 - 
orderedBypublic static <K,V> ImmutableSortedMap.Builder<K,V> orderedBy(Comparator<K> comparator) Returns a builder that creates immutable sorted maps with an explicit comparator. If the comparator has a more general type than the map's keys, such as creating aSortedMap<Integer, String>with aComparator<Number>, use theImmutableSortedMap.Builderconstructor instead.- Throws:
- NullPointerException- if- comparatoris null
 
 - 
reverseOrderpublic static <K extends Comparable<?>,V> ImmutableSortedMap.Builder<K,V> reverseOrder() Returns a builder that creates immutable sorted maps whose keys are ordered by the reverse of their natural ordering.
 - 
sizepublic int size() Description copied from interface:java.util.MapReturns the number of key-value mappings in this map. If the map contains more thanInteger.MAX_VALUEelements, returnsInteger.MAX_VALUE.
 - 
forEachpublic void forEach(BiConsumer<? super K,? super V> action) Description copied from interface:java.util.MapPerforms the given action for each entry in this map until all entries have been processed or the action throws an exception. Unless otherwise specified by the implementing class, actions are performed in the order of entry set iteration (if an iteration order is specified.) Exceptions thrown by the action are relayed to the caller.
 - 
get@CheckForNull public V get(@CheckForNull Object key) Description copied from interface:java.util.MapReturns the value to which the specified key is mapped, ornullif this map contains no mapping for the key.More formally, if this map contains a mapping from a key kto a valuevsuch thatObjects.equals(key, k), then this method returnsv; otherwise it returnsnull. (There can be at most one such mapping.)If this map permits null values, then a return value of nulldoes not necessarily indicate that the map contains no mapping for the key; it's also possible that the map explicitly maps the key tonull. ThecontainsKeyoperation may be used to distinguish these two cases.
 - 
entrySetpublic ImmutableSet<Map.Entry<K,V>> entrySet() Returns an immutable set of the mappings in this map, sorted by the key ordering.
 - 
keySetpublic ImmutableSortedSet<K> keySet() Returns an immutable sorted set of the keys in this map.
 - 
valuespublic ImmutableCollection<V> values() Returns an immutable collection of the values in this map, sorted by the ordering of the corresponding keys.
 - 
comparatorpublic Comparator<? super K> comparator() Returns the comparator that orders the keys, which isOrdering.natural()when the natural ordering of the keys is used. Note that its behavior is not consistent withTreeMap.comparator(), which returnsnullto indicate natural ordering.- Specified by:
- comparatorin interface- SortedMap<K,V>
- Returns:
- the comparator used to order the keys in this map,
         or nullif this map uses the natural ordering of its keys
 
 - 
firstKeypublic K firstKey() Description copied from interface:java.util.SortedMapReturns the first (lowest) key currently in this map.
 - 
lastKeypublic K lastKey() Description copied from interface:java.util.SortedMapReturns the last (highest) key currently in this map.
 - 
headMappublic ImmutableSortedMap<K,V> headMap(K toKey) This method returns aImmutableSortedMap, consisting of the entries whose keys are less thantoKey.The SortedMap.headMap(K)documentation states that a submap of a submap throws anIllegalArgumentExceptionif passed atoKeygreater than an earliertoKey. However, this method doesn't throw an exception in that situation, but instead keeps the originaltoKey.
 - 
headMappublic ImmutableSortedMap<K,V> headMap(K toKey, boolean inclusive) This method returns aImmutableSortedMap, consisting of the entries whose keys are less than (or equal to, ifinclusive)toKey.The SortedMap.headMap(K)documentation states that a submap of a submap throws anIllegalArgumentExceptionif passed atoKeygreater than an earliertoKey. However, this method doesn't throw an exception in that situation, but instead keeps the originaltoKey.- Specified by:
- headMapin interface- NavigableMap<K,V>
- Parameters:
- toKey- high endpoint of the keys in the returned map
- inclusive-- trueif the high endpoint is to be included in the returned view
- Returns:
- a view of the portion of this map whose keys are less than
         (or equal to, if inclusiveis true)toKey
- Since:
- 12.0
 
 - 
subMappublic ImmutableSortedMap<K,V> subMap(K fromKey, K toKey) This method returns aImmutableSortedMap, consisting of the entries whose keys ranges fromfromKey, inclusive, totoKey, exclusive.The SortedMap.subMap(K, K)documentation states that a submap of a submap throws anIllegalArgumentExceptionif passed afromKeyless than an earlierfromKey. However, this method doesn't throw an exception in that situation, but instead keeps the originalfromKey. Similarly, this method keeps the originaltoKey, instead of throwing an exception, if passed atoKeygreater than an earliertoKey.- Specified by:
- subMapin interface- NavigableMap<K,V>
- Specified by:
- subMapin interface- SortedMap<K,V>
- Parameters:
- fromKey- low endpoint (inclusive) of the keys in the returned map
- toKey- high endpoint (exclusive) of the keys in the returned map
- Returns:
- a view of the portion of this map whose keys range from
         fromKey, inclusive, totoKey, exclusive
 
 - 
subMappublic ImmutableSortedMap<K,V> subMap(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive) This method returns aImmutableSortedMap, consisting of the entries whose keys ranges fromfromKeytotoKey, inclusive or exclusive as indicated by the boolean flags.The SortedMap.subMap(K, K)documentation states that a submap of a submap throws anIllegalArgumentExceptionif passed afromKeyless than an earlierfromKey. However, this method doesn't throw an exception in that situation, but instead keeps the originalfromKey. Similarly, this method keeps the originaltoKey, instead of throwing an exception, if passed atoKeygreater than an earliertoKey.- Specified by:
- subMapin interface- NavigableMap<K,V>
- Parameters:
- fromKey- low endpoint of the keys in the returned map
- fromInclusive-- trueif the low endpoint is to be included in the returned view
- toKey- high endpoint of the keys in the returned map
- toInclusive-- trueif the high endpoint is to be included in the returned view
- Returns:
- a view of the portion of this map whose keys range from
         fromKeytotoKey
- Since:
- 12.0
 
 - 
tailMappublic ImmutableSortedMap<K,V> tailMap(K fromKey) This method returns aImmutableSortedMap, consisting of the entries whose keys are greater than or equals tofromKey.The SortedMap.tailMap(K)documentation states that a submap of a submap throws anIllegalArgumentExceptionif passed afromKeyless than an earlierfromKey. However, this method doesn't throw an exception in that situation, but instead keeps the originalfromKey.
 - 
tailMappublic ImmutableSortedMap<K,V> tailMap(K fromKey, boolean inclusive) This method returns aImmutableSortedMap, consisting of the entries whose keys are greater than (or equal to, ifinclusive)fromKey.The SortedMap.tailMap(K)documentation states that a submap of a submap throws anIllegalArgumentExceptionif passed afromKeyless than an earlierfromKey. However, this method doesn't throw an exception in that situation, but instead keeps the originalfromKey.- Specified by:
- tailMapin interface- NavigableMap<K,V>
- Parameters:
- fromKey- low endpoint of the keys in the returned map
- inclusive-- trueif the low endpoint is to be included in the returned view
- Returns:
- a view of the portion of this map whose keys are greater than
         (or equal to, if inclusiveis true)fromKey
- Since:
- 12.0
 
 - 
lowerEntry@CheckForNull public Map.Entry<K,V> lowerEntry(K key) Description copied from interface:java.util.NavigableMapReturns a key-value mapping associated with the greatest key strictly less than the given key, ornullif there is no such key.- Specified by:
- lowerEntryin interface- NavigableMap<K,V>
- Parameters:
- key- the key
- Returns:
- an entry with the greatest key less than key, ornullif there is no such key
 
 - 
lowerKey@CheckForNull public K lowerKey(K key) Description copied from interface:java.util.NavigableMapReturns the greatest key strictly less than the given key, ornullif there is no such key.- Specified by:
- lowerKeyin interface- NavigableMap<K,V>
- Parameters:
- key- the key
- Returns:
- the greatest key less than key, ornullif there is no such key
 
 - 
floorEntry@CheckForNull public Map.Entry<K,V> floorEntry(K key) Description copied from interface:java.util.NavigableMapReturns a key-value mapping associated with the greatest key less than or equal to the given key, ornullif there is no such key.- Specified by:
- floorEntryin interface- NavigableMap<K,V>
- Parameters:
- key- the key
- Returns:
- an entry with the greatest key less than or equal to
         key, ornullif there is no such key
 
 - 
floorKey@CheckForNull public K floorKey(K key) Description copied from interface:java.util.NavigableMapReturns the greatest key less than or equal to the given key, ornullif there is no such key.- Specified by:
- floorKeyin interface- NavigableMap<K,V>
- Parameters:
- key- the key
- Returns:
- the greatest key less than or equal to key, ornullif there is no such key
 
 - 
ceilingEntry@CheckForNull public Map.Entry<K,V> ceilingEntry(K key) Description copied from interface:java.util.NavigableMapReturns a key-value mapping associated with the least key greater than or equal to the given key, ornullif there is no such key.- Specified by:
- ceilingEntryin interface- NavigableMap<K,V>
- Parameters:
- key- the key
- Returns:
- an entry with the least key greater than or equal to
         key, ornullif there is no such key
 
 - 
ceilingKey@CheckForNull public K ceilingKey(K key) Description copied from interface:java.util.NavigableMapReturns the least key greater than or equal to the given key, ornullif there is no such key.- Specified by:
- ceilingKeyin interface- NavigableMap<K,V>
- Parameters:
- key- the key
- Returns:
- the least key greater than or equal to key, ornullif there is no such key
 
 - 
higherEntry@CheckForNull public Map.Entry<K,V> higherEntry(K key) Description copied from interface:java.util.NavigableMapReturns a key-value mapping associated with the least key strictly greater than the given key, ornullif there is no such key.- Specified by:
- higherEntryin interface- NavigableMap<K,V>
- Parameters:
- key- the key
- Returns:
- an entry with the least key greater than key, ornullif there is no such key
 
 - 
higherKey@CheckForNull public K higherKey(K key) Description copied from interface:java.util.NavigableMapReturns the least key strictly greater than the given key, ornullif there is no such key.- Specified by:
- higherKeyin interface- NavigableMap<K,V>
- Parameters:
- key- the key
- Returns:
- the least key greater than key, ornullif there is no such key
 
 - 
firstEntry@CheckForNull public Map.Entry<K,V> firstEntry() Description copied from interface:java.util.NavigableMapReturns a key-value mapping associated with the least key in this map, ornullif the map is empty.- Specified by:
- firstEntryin interface- NavigableMap<K,V>
- Returns:
- an entry with the least key,
         or nullif this map is empty
 
 - 
lastEntry@CheckForNull public Map.Entry<K,V> lastEntry() Description copied from interface:java.util.NavigableMapReturns a key-value mapping associated with the greatest key in this map, ornullif the map is empty.- Specified by:
- lastEntryin interface- NavigableMap<K,V>
- Returns:
- an entry with the greatest key,
         or nullif this map is empty
 
 - 
pollFirstEntry@CanIgnoreReturnValue @Deprecated @CheckForNull public final Map.Entry<K,V> pollFirstEntry() Deprecated.Unsupported operation.Guaranteed to throw an exception and leave the map unmodified.- Specified by:
- pollFirstEntryin interface- NavigableMap<K,V>
- Returns:
- the removed first entry of this map,
         or nullif this map is empty
- Throws:
- UnsupportedOperationException- always
 
 - 
pollLastEntry@CanIgnoreReturnValue @Deprecated @CheckForNull public final Map.Entry<K,V> pollLastEntry() Deprecated.Unsupported operation.Guaranteed to throw an exception and leave the map unmodified.- Specified by:
- pollLastEntryin interface- NavigableMap<K,V>
- Returns:
- the removed last entry of this map,
         or nullif this map is empty
- Throws:
- UnsupportedOperationException- always
 
 - 
descendingMappublic ImmutableSortedMap<K,V> descendingMap() Description copied from interface:java.util.NavigableMapReturns a reverse order view of the mappings contained in this map. The descending map is backed by this map, so changes to the map are reflected in the descending map, and vice-versa. If either map is modified while an iteration over a collection view of either map is in progress (except through the iterator's ownremoveoperation), the results of the iteration are undefined.The returned map has an ordering equivalent to Collections.reverseOrder(comparator()). The expressionm.descendingMap().descendingMap()returns a view ofmessentially equivalent tom.- Specified by:
- descendingMapin interface- NavigableMap<K,V>
- Returns:
- a reverse order view of this map
 
 - 
navigableKeySetpublic ImmutableSortedSet<K> navigableKeySet() Description copied from interface:java.util.NavigableMapReturns aNavigableSetview of the keys contained in this map. The set's iterator returns the keys in ascending order. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress (except through the iterator's ownremoveoperation), the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map, via theIterator.remove,Set.remove,removeAll,retainAll, andclearoperations. It does not support theaddoraddAlloperations.- Specified by:
- navigableKeySetin interface- NavigableMap<K,V>
- Returns:
- a navigable set view of the keys in this map
 
 - 
descendingKeySetpublic ImmutableSortedSet<K> descendingKeySet() Description copied from interface:java.util.NavigableMapReturns a reverse orderNavigableSetview of the keys contained in this map. The set's iterator returns the keys in descending order. The set is backed by the map, so changes to the map are reflected in the set, and vice-versa. If the map is modified while an iteration over the set is in progress (except through the iterator's ownremoveoperation), the results of the iteration are undefined. The set supports element removal, which removes the corresponding mapping from the map, via theIterator.remove,Set.remove,removeAll,retainAll, andclearoperations. It does not support theaddoraddAlloperations.- Specified by:
- descendingKeySetin interface- NavigableMap<K,V>
- Returns:
- a reverse order navigable set view of the keys in this map
 
 - 
toImmutableMap@Deprecated public static <T extends @Nullable Object,K,V> Collector<T,?,ImmutableMap<K,V>> toImmutableMap(Function<? super T,? extends K> keyFunction, Function<? super T,? extends V> valueFunction) Not supported. UsetoImmutableSortedMap(java.util.Comparator<? super K>, java.util.function.Function<? super T, ? extends K>, java.util.function.Function<? super T, ? extends V>), which offers better type-safety, instead. This method exists only to hideImmutableMap.toImmutableMap(java.util.function.Function<? super T, ? extends K>, java.util.function.Function<? super T, ? extends V>)from consumers ofImmutableSortedMap.- Throws:
- UnsupportedOperationException- always
 
 - 
toImmutableMap@Deprecated public static <T extends @Nullable Object,K,V> Collector<T,?,ImmutableMap<K,V>> toImmutableMap(Function<? super T,? extends K> keyFunction, Function<? super T,? extends V> valueFunction, BinaryOperator<V> mergeFunction) Not supported. UsetoImmutableSortedMap(java.util.Comparator<? super K>, java.util.function.Function<? super T, ? extends K>, java.util.function.Function<? super T, ? extends V>), which offers better type-safety, instead. This method exists only to hideImmutableMap.toImmutableMap(java.util.function.Function<? super T, ? extends K>, java.util.function.Function<? super T, ? extends V>)from consumers ofImmutableSortedMap.- Throws:
- UnsupportedOperationException- always
 
 - 
builder@Deprecated public static <K,V> ImmutableSortedMap.Builder<K,V> builder() Deprecated.UsenaturalOrder(), which offers better type-safety.Not supported. UsenaturalOrder(), which offers better type-safety, instead. This method exists only to hideImmutableMap.builder()from consumers ofImmutableSortedMap.- Throws:
- UnsupportedOperationException- always
 
 - 
builderWithExpectedSize@Deprecated public static <K,V> ImmutableSortedMap.Builder<K,V> builderWithExpectedSize(int expectedSize) Deprecated.Not supported for ImmutableSortedMap.Not supported for ImmutableSortedMap.- Throws:
- UnsupportedOperationException- always
 
 - 
of@Deprecated public static <K,V> ImmutableSortedMap<K,V> of(K k1, V v1) Deprecated.Pass a key of typeComparableto useof(Comparable, Object).Not supported. You are attempting to create a map that may contain a non-Comparablekey. Proper calls will resolve to the version inImmutableSortedMap, not this dummy version.- Type Parameters:
- K- the- Map's key type
- V- the- Map's value type
- Parameters:
- k1- the mapping's key
- v1- the mapping's value
- Returns:
- a Mapcontaining the specified mapping
- Throws:
- UnsupportedOperationException- always
 
 - 
of@Deprecated public static <K,V> ImmutableSortedMap<K,V> of(K k1, V v1, K k2, V v2) Deprecated.Pass keys of typeComparableto useof(Comparable, Object, Comparable, Object).Not supported. You are attempting to create a map that may contain non-Comparablekeys. Proper calls will resolve to the version inImmutableSortedMap, not this dummy version.- Type Parameters:
- K- the- Map's key type
- V- the- Map's value type
- Parameters:
- k1- the first mapping's key
- v1- the first mapping's value
- k2- the second mapping's key
- v2- the second mapping's value
- Returns:
- a Mapcontaining the specified mappings
- Throws:
- UnsupportedOperationException- always
 
 - 
of@Deprecated public static <K,V> ImmutableSortedMap<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3) Deprecated.Pass keys of typeComparableto useof(Comparable, Object, Comparable, Object, Comparable, Object).Not supported. You are attempting to create a map that may contain non-Comparablekeys. Proper calls to will resolve to the version inImmutableSortedMap, not this dummy version.- Type Parameters:
- K- the- Map's key type
- V- the- Map's value type
- Parameters:
- k1- the first mapping's key
- v1- the first mapping's value
- k2- the second mapping's key
- v2- the second mapping's value
- k3- the third mapping's key
- v3- the third mapping's value
- Returns:
- a Mapcontaining the specified mappings
- Throws:
- UnsupportedOperationException- always
 
 - 
of@Deprecated public static <K,V> ImmutableSortedMap<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4) Deprecated.Pass keys of typeComparableto useof(Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object).Not supported. You are attempting to create a map that may contain non-Comparablekeys. Proper calls will resolve to the version inImmutableSortedMap, not this dummy version.- Type Parameters:
- K- the- Map's key type
- V- the- Map's value type
- Parameters:
- k1- the first mapping's key
- v1- the first mapping's value
- k2- the second mapping's key
- v2- the second mapping's value
- k3- the third mapping's key
- v3- the third mapping's value
- k4- the fourth mapping's key
- v4- the fourth mapping's value
- Returns:
- a Mapcontaining the specified mappings
- Throws:
- UnsupportedOperationException- always
 
 - 
of@Deprecated public static <K,V> ImmutableSortedMap<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5) Deprecated.Pass keys of typeComparableto useof(Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object).Not supported. You are attempting to create a map that may contain non-Comparablekeys. Proper calls will resolve to the version inImmutableSortedMap, not this dummy version.- Type Parameters:
- K- the- Map's key type
- V- the- Map's value type
- Parameters:
- k1- the first mapping's key
- v1- the first mapping's value
- k2- the second mapping's key
- v2- the second mapping's value
- k3- the third mapping's key
- v3- the third mapping's value
- k4- the fourth mapping's key
- v4- the fourth mapping's value
- k5- the fifth mapping's key
- v5- the fifth mapping's value
- Returns:
- a Mapcontaining the specified mappings
- Throws:
- UnsupportedOperationException- always
 
 - 
of@Deprecated public static <K,V> ImmutableSortedMap<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6) Deprecated.Pass keys of typeComparableto useof(Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object).Not supported. You are attempting to create a map that may contain non-Comparablekeys. Proper calls will resolve to the version inImmutableSortedMap, not this dummy version.- Type Parameters:
- K- the- Map's key type
- V- the- Map's value type
- Parameters:
- k1- the first mapping's key
- v1- the first mapping's value
- k2- the second mapping's key
- v2- the second mapping's value
- k3- the third mapping's key
- v3- the third mapping's value
- k4- the fourth mapping's key
- v4- the fourth mapping's value
- k5- the fifth mapping's key
- v5- the fifth mapping's value
- k6- the sixth mapping's key
- v6- the sixth mapping's value
- Returns:
- a Mapcontaining the specified mappings
- Throws:
- UnsupportedOperationException- always
 
 - 
of@Deprecated public static <K,V> ImmutableSortedMap<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7) Deprecated.Pass keys of typeComparableto useof(Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object).Not supported. You are attempting to create a map that may contain non-Comparablekeys. Proper calls will resolve to the version inImmutableSortedMap, not this dummy version.- Type Parameters:
- K- the- Map's key type
- V- the- Map's value type
- Parameters:
- k1- the first mapping's key
- v1- the first mapping's value
- k2- the second mapping's key
- v2- the second mapping's value
- k3- the third mapping's key
- v3- the third mapping's value
- k4- the fourth mapping's key
- v4- the fourth mapping's value
- k5- the fifth mapping's key
- v5- the fifth mapping's value
- k6- the sixth mapping's key
- v6- the sixth mapping's value
- k7- the seventh mapping's key
- v7- the seventh mapping's value
- Returns:
- a Mapcontaining the specified mappings
- Throws:
- UnsupportedOperationException- always
 
 - 
of@Deprecated public static <K,V> ImmutableSortedMap<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8) Deprecated.Pass keys of typeComparableto useof(Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object).Not supported. You are attempting to create a map that may contain non-Comparablekeys. Proper calls will resolve to the version inImmutableSortedMap, not this dummy version.- Type Parameters:
- K- the- Map's key type
- V- the- Map's value type
- Parameters:
- k1- the first mapping's key
- v1- the first mapping's value
- k2- the second mapping's key
- v2- the second mapping's value
- k3- the third mapping's key
- v3- the third mapping's value
- k4- the fourth mapping's key
- v4- the fourth mapping's value
- k5- the fifth mapping's key
- v5- the fifth mapping's value
- k6- the sixth mapping's key
- v6- the sixth mapping's value
- k7- the seventh mapping's key
- v7- the seventh mapping's value
- k8- the eighth mapping's key
- v8- the eighth mapping's value
- Returns:
- a Mapcontaining the specified mappings
- Throws:
- UnsupportedOperationException- always
 
 - 
of@Deprecated public static <K,V> ImmutableSortedMap<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9) Deprecated.Pass keys of typeComparableto useof(Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object).Not supported. You are attempting to create a map that may contain non-Comparablekeys. Proper calls will resolve to the version inImmutableSortedMap, not this dummy version.- Type Parameters:
- K- the- Map's key type
- V- the- Map's value type
- Parameters:
- k1- the first mapping's key
- v1- the first mapping's value
- k2- the second mapping's key
- v2- the second mapping's value
- k3- the third mapping's key
- v3- the third mapping's value
- k4- the fourth mapping's key
- v4- the fourth mapping's value
- k5- the fifth mapping's key
- v5- the fifth mapping's value
- k6- the sixth mapping's key
- v6- the sixth mapping's value
- k7- the seventh mapping's key
- v7- the seventh mapping's value
- k8- the eighth mapping's key
- v8- the eighth mapping's value
- k9- the ninth mapping's key
- v9- the ninth mapping's value
- Returns:
- a Mapcontaining the specified mappings
- Throws:
- UnsupportedOperationException- always
 
 - 
of@Deprecated public static <K,V> ImmutableSortedMap<K,V> of(K k1, V v1, K k2, V v2, K k3, V v3, K k4, V v4, K k5, V v5, K k6, V v6, K k7, V v7, K k8, V v8, K k9, V v9, K k10, V v10) Deprecated.Pass keys of typeComparableto useof(Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object, Comparable, Object).Not supported. You are attempting to create a map that may contain non-Comparablekeys. Proper calls will resolve to the version inImmutableSortedMap, not this dummy version.- Type Parameters:
- K- the- Map's key type
- V- the- Map's value type
- Parameters:
- k1- the first mapping's key
- v1- the first mapping's value
- k2- the second mapping's key
- v2- the second mapping's value
- k3- the third mapping's key
- v3- the third mapping's value
- k4- the fourth mapping's key
- v4- the fourth mapping's value
- k5- the fifth mapping's key
- v5- the fifth mapping's value
- k6- the sixth mapping's key
- v6- the sixth mapping's value
- k7- the seventh mapping's key
- v7- the seventh mapping's value
- k8- the eighth mapping's key
- v8- the eighth mapping's value
- k9- the ninth mapping's key
- v9- the ninth mapping's value
- k10- the tenth mapping's key
- v10- the tenth mapping's value
- Returns:
- a Mapcontaining the specified mappings
- Throws:
- UnsupportedOperationException- always
 
 - 
ofEntries@Deprecated public static <K,V> ImmutableSortedMap<K,V> ofEntries(Map.Entry<? extends K,? extends V>... entries) Deprecated.UseImmutableSortedMap.copyOf(ImmutableMap.ofEntries(...)).Not supported. UseImmutableSortedMap.copyOf(ImmutableMap.ofEntries(...)).- Type Parameters:
- K- the- Map's key type
- V- the- Map's value type
- Parameters:
- entries-- Map.Entrys containing the keys and values from which the map is populated
- Returns:
- a Mapcontaining the specified mappings
- See Also:
- Map.entry()
 
 
- 
 
-