Package com.github.tonivade.purefun.data
Interface ImmutableTreeMap<K,V>
- Type Parameters:
K- the type of keys maintained by this mapV- the type of mapped values
- All Superinterfaces:
ImmutableMap<K,,V> Iterable<Tuple2<K,V>>
- All Known Implementing Classes:
ImmutableTreeMap.PImmutableTreeMap
Similar to a TreeMap
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classImmutableTreeMap.Builder<K extends Comparable<?>,V> static final classNested classes/interfaces inherited from interface com.github.tonivade.purefun.data.ImmutableMap
ImmutableMap.PImmutableMap<K,V> -
Method Summary
Modifier and TypeMethodDescriptiondefault <A,B> ImmutableTreeMap <A, B> default <A,B> ImmutableTreeMap <A, B> bimap(Comparator<? super A> comparator, Function1<? super K, ? extends A> keyMapper, Function1<? super V, ? extends B> valueMapper) static <K extends Comparable<?>,V>
ImmutableTreeMap.Builder<K, V> builder()ceilingEntry(K key) ceilingKey(K key) static <K,V> ImmutableTreeMap <K, V> empty()static <K,V> Tuple2 <K, V> entry(K key, V value) default ImmutableTreeMap<K, V> filterKeys(Matcher1<? super K> filter) default ImmutableTreeMap<K, V> filterValues(Matcher1<? super V> filter) floorEntry(K key) static <K,V> ImmutableTreeMap <K, V> from(ImmutableSet<Tuple2<K, V>> entries) static <K,V> ImmutableTreeMap <K, V> from(Comparator<? super K> comparator, ImmutableSet<Tuple2<K, V>> entries) static <K,V> ImmutableTreeMap <K, V> from(Comparator<? super K> comparator, Map<K, V> map) static <K,V> ImmutableTreeMap <K, V> from(Comparator<? super K> comparator, Set<Map.Entry<K, V>> entries) static <K,V> ImmutableTreeMap <K, V> from(Comparator<? super K> comparator, Stream<Tuple2<K, V>> entries) static <K,V> ImmutableTreeMap <K, V> static <K,V> ImmutableTreeMap <K, V> static <K,V> ImmutableTreeMap <K, V> default VgetOrDefault(K key, Producer<? extends V> supplier) headKey()higherEntry(K key) default booleanisEmpty()lowerEntry(K key) default <A> ImmutableTreeMap<A, V> default <A> ImmutableTreeMap<A, V> mapKeys(Comparator<? super A> comparator, Function1<? super K, ? extends A> mapper) default <A> ImmutableTreeMap<K, A> private static <R> Comparator<R> static <K,V> ImmutableTreeMap <K, V> putAll(ImmutableMap<? extends K, ? extends V> other) default ImmutableTreeMap<K, V> putIfAbsent(K key, V value) tailKey()private static <V> VthrowingMerge(V a, V b) static <T,K, V> Collector <T, ?, ImmutableTreeMap<K, V>> toImmutableTreeMap(Function1<? super T, ? extends K> keyMapper, Function1<? super T, ? extends V> valueMapper) static <T,K, V> Collector <T, ?, ImmutableTreeMap<K, V>> toImmutableTreeMap(Comparator<? super K> comparator, Function1<? super T, ? extends K> keyMapper, Function1<? super T, ? extends V> valueMapper) default SequencedMap<K, V> toTreeMap(Comparator<? super K> comparator, Function1<? super T, ? extends K> keyMapper, Function1<? super T, ? extends V> valueMapper) Methods inherited from interface com.github.tonivade.purefun.data.ImmutableMap
containsKey, entries, forEach, get, iterator, keys, size, toMap, valuesMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
comparator
Comparator<K> comparator() -
toSequencedMap
-
toSortedMap
-
put
- Specified by:
putin interfaceImmutableMap<K,V>
-
putAll
- Specified by:
putAllin interfaceImmutableMap<K,V>
-
remove
- Specified by:
removein interfaceImmutableMap<K,V>
-
removeAll
- Specified by:
removeAllin interfaceImmutableMap<K,V>
-
merge
- Specified by:
mergein interfaceImmutableMap<K,V>
-
headMap
-
tailMap
-
headEntry
-
tailEntry
-
higherEntry
-
lowerEntry
-
floorEntry
-
ceilingEntry
-
headKey
-
tailKey
-
higherKey
-
lowerKey
-
floorKey
-
ceilingKey
-
bimap
default <A,B> ImmutableTreeMap<A,B> bimap(Function1<? super K, ? extends A> keyMapper, Function1<? super V, ? extends B> valueMapper) - Specified by:
bimapin interfaceImmutableMap<K,V>
-
bimap
default <A,B> ImmutableTreeMap<A,B> bimap(Comparator<? super A> comparator, Function1<? super K, ? extends A> keyMapper, Function1<? super V, ? extends B> valueMapper) -
mapKeys
- Specified by:
mapKeysin interfaceImmutableMap<K,V>
-
mapKeys
default <A> ImmutableTreeMap<A,V> mapKeys(Comparator<? super A> comparator, Function1<? super K, ? extends A> mapper) -
mapValues
- Specified by:
mapValuesin interfaceImmutableMap<K,V>
-
filterKeys
- Specified by:
filterKeysin interfaceImmutableMap<K,V>
-
filterValues
- Specified by:
filterValuesin interfaceImmutableMap<K,V>
-
putIfAbsent
- Specified by:
putIfAbsentin interfaceImmutableMap<K,V>
-
getOrDefault
- Specified by:
getOrDefaultin interfaceImmutableMap<K,V>
-
isEmpty
default boolean isEmpty()- Specified by:
isEmptyin interfaceImmutableMap<K,V>
-
of
-
entry
-
from
-
from
-
empty
-
from
-
from
static <K,V> ImmutableTreeMap<K,V> from(Comparator<? super K> comparator, Stream<Tuple2<K, V>> entries) -
from
-
from
static <K,V> ImmutableTreeMap<K,V> from(Comparator<? super K> comparator, ImmutableSet<Tuple2<K, V>> entries) -
from
-
from
static <K,V> ImmutableTreeMap<K,V> from(Comparator<? super K> comparator, Set<Map.Entry<K, V>> entries) -
toImmutableTreeMap
static <T,K, Collector<T,V> ?, toImmutableTreeMapImmutableTreeMap<K, V>> (Function1<? super T, ? extends K> keyMapper, Function1<? super T, ? extends V> valueMapper) -
toImmutableTreeMap
static <T,K, Collector<T,V> ?, toImmutableTreeMapImmutableTreeMap<K, V>> (Comparator<? super K> comparator, Function1<? super T, ? extends K> keyMapper, Function1<? super T, ? extends V> valueMapper) -
builder
-
naturalOrder
-
toTreeMap
private static <T,K, Collector<T,V> ?, toTreeMap? extends TreeMap<K, V>> (Comparator<? super K> comparator, Function1<? super T, ? extends K> keyMapper, Function1<? super T, ? extends V> valueMapper) -
throwingMerge
private static <V> V throwingMerge(V a, V b)
-