Class ImmutableNavigableMap<K,V>

Type Parameters:
K - the key type
V - the value type
All Implemented Interfaces:
Immutable, Map<K,V>, NavigableMap<K,V>, SortedMap<K,V>

public class ImmutableNavigableMap<K,V> extends ImmutableSortedMap<K,V> implements NavigableMap<K,V>
Since:
1.1.4
Author:
Haiyang Li
  • Method Details

    • empty

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

      public static <K extends Comparable<? super K>, V> ImmutableNavigableMap<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> ImmutableNavigableMap<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> ImmutableNavigableMap<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> ImmutableNavigableMap<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> ImmutableNavigableMap<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> ImmutableNavigableMap<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> ImmutableNavigableMap<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> ImmutableNavigableMap<K,V> of(NavigableMap<? extends K,? extends V> navigableMap)
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      navigableMap - the elements in this map are shared by the returned ImmutableNavigableMap.
      Returns:
    • copyOf

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

      @Deprecated public static <K, V> ImmutableSortedMap<K,V> of(SortedMap<? extends K,? extends V> sortedMap) throws UnsupportedOperationException
      Deprecated.
      throws UnsupportedOperationException
      Type Parameters:
      K - the key type
      V - the value type
      Parameters:
      sortedMap -
      Returns:
      Throws:
      UnsupportedOperationException
    • lowerEntry

      public Map.Entry<K,V> lowerEntry(K key)
      Specified by:
      lowerEntry in interface NavigableMap<K,V>
      Parameters:
      key -
      Returns:
    • lowerKey

      public K lowerKey(K key)
      Specified by:
      lowerKey in interface NavigableMap<K,V>
      Parameters:
      key -
      Returns:
    • floorEntry

      public Map.Entry<K,V> floorEntry(K key)
      Specified by:
      floorEntry in interface NavigableMap<K,V>
      Parameters:
      key -
      Returns:
    • floorKey

      public K floorKey(K key)
      Specified by:
      floorKey in interface NavigableMap<K,V>
      Parameters:
      key -
      Returns:
    • ceilingEntry

      public Map.Entry<K,V> ceilingEntry(K key)
      Specified by:
      ceilingEntry in interface NavigableMap<K,V>
      Parameters:
      key -
      Returns:
    • ceilingKey

      public K ceilingKey(K key)
      Specified by:
      ceilingKey in interface NavigableMap<K,V>
      Parameters:
      key -
      Returns:
    • higherEntry

      public Map.Entry<K,V> higherEntry(K key)
      Specified by:
      higherEntry in interface NavigableMap<K,V>
      Parameters:
      key -
      Returns:
    • higherKey

      public K higherKey(K key)
      Specified by:
      higherKey in interface NavigableMap<K,V>
      Parameters:
      key -
      Returns:
    • firstEntry

      public Map.Entry<K,V> firstEntry()
      Specified by:
      firstEntry in interface NavigableMap<K,V>
    • lastEntry

      public Map.Entry<K,V> lastEntry()
      Specified by:
      lastEntry in interface NavigableMap<K,V>
    • pollFirstEntry

      public Map.Entry<K,V> pollFirstEntry()
      Poll first entry.
      Specified by:
      pollFirstEntry in interface NavigableMap<K,V>
      Returns:
    • pollLastEntry

      public Map.Entry<K,V> pollLastEntry()
      Poll last entry.
      Specified by:
      pollLastEntry in interface NavigableMap<K,V>
      Returns:
    • descendingMap

      public NavigableMap<K,V> descendingMap()
      Specified by:
      descendingMap in interface NavigableMap<K,V>
    • descendingKeySet

      public NavigableSet<K> descendingKeySet()
      Descending key set.
      Specified by:
      descendingKeySet in interface NavigableMap<K,V>
      Returns:
    • subMap

      public NavigableMap<K,V> subMap(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive)
      Specified by:
      subMap in interface NavigableMap<K,V>
      Parameters:
      fromKey -
      fromInclusive -
      toKey -
      toInclusive -
      Returns:
    • headMap

      public NavigableMap<K,V> headMap(K toKey, boolean inclusive)
      Specified by:
      headMap in interface NavigableMap<K,V>
      Parameters:
      toKey -
      inclusive -
      Returns:
    • tailMap

      public NavigableMap<K,V> tailMap(K fromKey, boolean inclusive)
      Specified by:
      tailMap in interface NavigableMap<K,V>
      Parameters:
      fromKey -
      inclusive -
      Returns: