Class ImmutableSortedMap<K,​V>

  • Type Parameters:
    K - the key type
    V - the value type
    All Implemented Interfaces:
    Map<K,​V>, SortedMap<K,​V>
    Direct Known Subclasses:
    ImmutableNavigableMap

    public class ImmutableSortedMap<K,​V>
    extends ImmutableMap<K,​V>
    implements SortedMap<K,​V>
    The Class ImmutableSortedMap.
    Since:
    1.1.4
    Author:
    Haiyang Li
    • Method Detail

      • empty

        public static <K,​V> ImmutableSortedMap<K,​V> empty()
        Type Parameters:
        K - the key type
        V - the value type
        Returns:
      • of

        public static <K extends Comparable<? super K>,​V,​k extends K,​v extends V> ImmutableSortedMap<K,​V> of​(k k1,
                                                                                                                                     v v1)
        Type Parameters:
        K - the key type
        V - the value type
        k -
        v -
        Parameters:
        k1 -
        v1 -
        Returns:
      • of

        public static <K extends Comparable<? super K>,​V,​k extends K,​v extends V> ImmutableSortedMap<K,​V> of​(k k1,
                                                                                                                                     v v1,
                                                                                                                                     k k2,
                                                                                                                                     v v2)
        Type Parameters:
        K - the key type
        V - the value type
        k -
        v -
        Parameters:
        k1 -
        v1 -
        k2 -
        v2 -
        Returns:
      • of

        public static <K extends Comparable<? super K>,​V,​k extends K,​v extends V> ImmutableSortedMap<K,​V> of​(k k1,
                                                                                                                                     v v1,
                                                                                                                                     k k2,
                                                                                                                                     v v2,
                                                                                                                                     k k3,
                                                                                                                                     v v3)
        Type Parameters:
        K - the key type
        V - the value type
        k -
        v -
        Parameters:
        k1 -
        v1 -
        k2 -
        v2 -
        k3 -
        v3 -
        Returns:
      • of

        public static <K extends Comparable<? super K>,​V,​k extends K,​v extends V> ImmutableSortedMap<K,​V> of​(k k1,
                                                                                                                                     v v1,
                                                                                                                                     k k2,
                                                                                                                                     v v2,
                                                                                                                                     k k3,
                                                                                                                                     v v3,
                                                                                                                                     k k4,
                                                                                                                                     v v4)
        Type Parameters:
        K - the key type
        V - the value type
        k -
        v -
        Parameters:
        k1 -
        v1 -
        k2 -
        v2 -
        k3 -
        v3 -
        k4 -
        v4 -
        Returns:
      • of

        public static <K extends Comparable<? super K>,​V,​k extends K,​v extends 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)
        Type Parameters:
        K - the key type
        V - the value type
        k -
        v -
        Parameters:
        k1 -
        v1 -
        k2 -
        v2 -
        k3 -
        v3 -
        k4 -
        v4 -
        k5 -
        v5 -
        Returns:
      • of

        public static <K extends Comparable<? super K>,​V,​k extends K,​v extends 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)
        Type Parameters:
        K - the key type
        V - the value type
        k -
        v -
        Parameters:
        k1 -
        v1 -
        k2 -
        v2 -
        k3 -
        v3 -
        k4 -
        v4 -
        k5 -
        v5 -
        k6 -
        v6 -
        Returns:
      • of

        public static <K extends Comparable<? super K>,​V,​k extends K,​v extends 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)
        Type Parameters:
        K - the key type
        V - the value type
        k -
        v -
        Parameters:
        k1 -
        v1 -
        k2 -
        v2 -
        k3 -
        v3 -
        k4 -
        v4 -
        k5 -
        v5 -
        k6 -
        v6 -
        k7 -
        v7 -
        Returns:
      • of

        public static <K,​V> ImmutableSortedMap<K,​V> of​(SortedMap<? extends K,​? extends V> sortedMap)
        Type Parameters:
        K - the key type
        V - the value type
        Parameters:
        sortedMap - the elements in this map are shared by the returned ImmutableSortedMap.
        Returns:
      • copyOf

        public static <K,​V> ImmutableSortedMap<K,​V> copyOf​(SortedMap<? extends K,​? extends V> sortedMap)
        Type Parameters:
        K - the key type
        V - the value type
        Parameters:
        sortedMap -
        Returns:
      • subMap

        public SortedMap<K,​V> subMap​(K fromKey,
                                           K toKey)
        Specified by:
        subMap in interface SortedMap<K,​V>
        Parameters:
        fromKey -
        toKey -
        Returns: