Package com.landawn.abacus.util
Class ImmutableNavigableMap<K,V>
java.lang.Object
java.util.AbstractMap<K,V>
com.landawn.abacus.util.ImmutableMap<K,V>
com.landawn.abacus.util.ImmutableSortedMap<K,V>
com.landawn.abacus.util.ImmutableNavigableMap<K,V>
- Type Parameters:
K
- the key typeV
- 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
-
Nested Class Summary
Nested classes/interfaces inherited from class com.landawn.abacus.util.ImmutableMap
ImmutableMap.Builder<K,
V> Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Method Summary
Modifier and TypeMethodDescriptionceilingEntry
(K key) ceilingKey
(K key) static <K,
V> ImmutableNavigableMap<K, V> Descending key set.static <K,
V> ImmutableNavigableMap<K, V> empty()
floorEntry
(K key) higherEntry
(K key) lowerEntry
(K key) Navigable key set.static <K extends Comparable<? super K>,
V>
ImmutableNavigableMap<K,V> of
(K k1, V v1) static <K extends Comparable<? super K>,
V>
ImmutableNavigableMap<K,V> of
(K k1, V v1, K k2, V v2) static <K extends Comparable<? super K>,
V>
ImmutableNavigableMap<K,V> of
(K k1, V v1, K k2, V v2, K k3, V v3) 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) 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) 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) 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) Deprecated.Deprecated.throwsUnsupportedOperationException
static <K,
V> ImmutableNavigableMap<K, V> wrap
(NavigableMap<? extends K, ? extends V> navigableMap) Deprecated.the ImmutableNavigableMap may be modified through the specifiednavigableMap
static <K,
V> ImmutableSortedMap<K, V> Deprecated.throwsUnsupportedOperationException
Methods inherited from class com.landawn.abacus.util.ImmutableSortedMap
comparator, copyOf, firstKey, headMap, lastKey, subMap, tailMap, wrap
Methods inherited from class com.landawn.abacus.util.ImmutableMap
builder, builder, clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, get, getOrDefault, isEmpty, keySet, merge, of, of, of, of, of, of, of, put, putAll, putIfAbsent, remove, remove, replace, replace, size, values
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
Methods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, equals, forEach, get, getOrDefault, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size
Methods inherited from interface java.util.NavigableMap
headMap, subMap, tailMap
-
Method Details
-
empty
- Type Parameters:
K
- the key typeV
- the value type- Returns:
-
of
- Type Parameters:
K
- the key typeV
- the value typek
-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 typeV
- the value typek
-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 typeV
- the value typek
-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 typeV
- the value typek
-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 typeV
- the value typek
-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 typeV
- the value typek
-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 typeV
- the value typek
-v
-- Parameters:
k1
-v1
-k2
-v2
-k3
-v3
-k4
-v4
-k5
-v5
-k6
-v6
-k7
-v7
-- Returns:
-
copyOf
public static <K,V> ImmutableNavigableMap<K,V> copyOf(SortedMap<? extends K, ? extends V> sortedMap) - Type Parameters:
K
- the key typeV
- the value type- Parameters:
sortedMap
-- Returns:
-
wrap
@Deprecated public static <K,V> ImmutableSortedMap<K,V> wrap(SortedMap<? extends K, ? extends V> sortedMap) throws UnsupportedOperationExceptionDeprecated.throwsUnsupportedOperationException
- Type Parameters:
K
- the key typeV
- the value type- Parameters:
sortedMap
-- Returns:
- Throws:
UnsupportedOperationException
-
lowerEntry
- Specified by:
lowerEntry
in interfaceNavigableMap<K,
V> - Parameters:
key
-- Returns:
-
lowerKey
- Specified by:
lowerKey
in interfaceNavigableMap<K,
V> - Parameters:
key
-- Returns:
-
floorEntry
- Specified by:
floorEntry
in interfaceNavigableMap<K,
V> - Parameters:
key
-- Returns:
-
floorKey
- Specified by:
floorKey
in interfaceNavigableMap<K,
V> - Parameters:
key
-- Returns:
-
ceilingEntry
- Specified by:
ceilingEntry
in interfaceNavigableMap<K,
V> - Parameters:
key
-- Returns:
-
ceilingKey
- Specified by:
ceilingKey
in interfaceNavigableMap<K,
V> - Parameters:
key
-- Returns:
-
higherEntry
- Specified by:
higherEntry
in interfaceNavigableMap<K,
V> - Parameters:
key
-- Returns:
-
higherKey
- Specified by:
higherKey
in interfaceNavigableMap<K,
V> - Parameters:
key
-- Returns:
-
firstEntry
- Specified by:
firstEntry
in interfaceNavigableMap<K,
V>
-
lastEntry
- Specified by:
lastEntry
in interfaceNavigableMap<K,
V>
-
pollFirstEntry
Deprecated.throwsUnsupportedOperationException
Poll first entry.- Specified by:
pollFirstEntry
in interfaceNavigableMap<K,
V> - Returns:
- Throws:
UnsupportedOperationException
-
pollLastEntry
Deprecated.throwsUnsupportedOperationException
Poll last entry.- Specified by:
pollLastEntry
in interfaceNavigableMap<K,
V> - Returns:
- Throws:
UnsupportedOperationException
-
descendingMap
- Specified by:
descendingMap
in interfaceNavigableMap<K,
V>
-
descendingKeySet
Descending key set.- Specified by:
descendingKeySet
in interfaceNavigableMap<K,
V> - Returns:
-
subMap
public ImmutableNavigableMap<K,V> subMap(K fromKey, boolean fromInclusive, K toKey, boolean toInclusive) - Specified by:
subMap
in interfaceNavigableMap<K,
V> - Parameters:
fromKey
-fromInclusive
-toKey
-toInclusive
-- Returns:
-
headMap
- Specified by:
headMap
in interfaceNavigableMap<K,
V> - Parameters:
toKey
-inclusive
-- Returns:
-
tailMap
- Specified by:
tailMap
in interfaceNavigableMap<K,
V> - Parameters:
fromKey
-inclusive
-- Returns:
-
UnsupportedOperationException