public interface ISortedMap<K,V> extends IMap<K,V>
Modifier and Type | Interface and Description |
---|---|
static class |
ISortedMap.Mixin<K,V> |
IMap.Durable<K,V>
Modifier and Type | Method and Description |
---|---|
default IEntry<K,V> |
ceil(K key) |
default IEntry<K,V> |
ceil(K key,
ISortedSet.Bound bound) |
default OptionalLong |
ceilIndex(K key) |
default OptionalLong |
ceilIndex(K key,
ISortedSet.Bound bound) |
Comparator<K> |
comparator() |
default ISortedMap<K,V> |
difference(IMap<K,?> m) |
default ISortedMap<K,V> |
difference(ISet<K> keys) |
default IDiffSortedMap<K,V> |
diffSorted() |
default IEntry<K,V> |
first() |
default IEntry<K,V> |
floor(K key) |
default IEntry<K,V> |
floor(K key,
ISortedSet.Bound bound) |
default OptionalLong |
floorIndex(K key) |
default OptionalLong |
floorIndex(K key,
ISortedSet.Bound bound) |
default ISortedMap<K,V> |
forked()
This returns a data structure which is forked, which is equivalent to Clojure's persistent
data structures, also sometimes called functional or immutable.
|
OptionalLong |
inclusiveFloorIndex(K key) |
default OptionalLong |
indexOf(K key) |
default ISortedMap<K,V> |
intersection(ISet<K> keys) |
default BiPredicate<K,K> |
keyEquality() |
default ToLongFunction<K> |
keyHash() |
default ISortedSet<K> |
keys() |
default IEntry<K,V> |
last() |
default ISortedMap<K,V> |
linear()
This returns a data structure which is linear, or temporarily mutable.
|
default ISortedMap<K,V> |
merge(IMap<K,V> b,
BinaryOperator<V> mergeFn) |
default ISortedMap<K,V> |
put(K key,
V value) |
default ISortedMap<K,V> |
put(K key,
V value,
BinaryOperator<V> merge) |
default ISortedMap<K,V> |
remove(K key) |
default IDiffSortedMap<K,V> |
slice(K min,
ISortedSet.Bound minBound,
K max,
ISortedSet.Bound maxBound) |
default IDiffSortedMap<K,V> |
slice(K min,
K max) |
default ISortedMap<K,V> |
sliceIndices(long startIndex,
long endIndex) |
default ISortedMap<K,V> |
union(IMap<K,V> m) |
default ISortedMap<K,V> |
update(K key,
UnaryOperator<V> update) |
apply, contains, containsAll, containsAll, containsAny, containsAny, diff, entries, equals, get, get, getOrCreate, hashSortedEntries, intersection, isLinear, iterator, mapValues, save, split, spliterator, stream, toMap, values
Comparator<K> comparator()
OptionalLong inclusiveFloorIndex(K key)
default OptionalLong floorIndex(K key)
default OptionalLong floorIndex(K key, ISortedSet.Bound bound)
default OptionalLong ceilIndex(K key)
default OptionalLong ceilIndex(K key, ISortedSet.Bound bound)
default ToLongFunction<K> keyHash()
default BiPredicate<K,K> keyEquality()
keyEquality
in interface IMap<K,V>
default ISortedSet<K> keys()
default OptionalLong indexOf(K key)
default IEntry<K,V> floor(K key, ISortedSet.Bound bound)
key
, or just below it. If key
is less than the
minimum value in the map, returns null
.default IEntry<K,V> ceil(K key, ISortedSet.Bound bound)
key
, or just above it. If key
is greater than the
maximum value in the map, returns null
.default IDiffSortedMap<K,V> slice(K min, K max)
min
- the inclusive minimum key valuemax
- the inclusive maximum key valuedefault IDiffSortedMap<K,V> slice(K min, ISortedSet.Bound minBound, K max, ISortedSet.Bound maxBound)
default ISortedMap<K,V> sliceIndices(long startIndex, long endIndex)
sliceIndices
in interface IMap<K,V>
default ISortedMap<K,V> merge(IMap<K,V> b, BinaryOperator<V> mergeFn)
default ISortedMap<K,V> difference(ISet<K> keys)
difference
in interface IMap<K,V>
keys
default ISortedMap<K,V> intersection(ISet<K> keys)
intersection
in interface IMap<K,V>
keys
default ISortedMap<K,V> difference(IMap<K,?> m)
difference
in interface IMap<K,V>
m
default ISortedMap<K,V> put(K key, V value, BinaryOperator<V> merge)
default ISortedMap<K,V> update(K key, UnaryOperator<V> update)
default ISortedMap<K,V> put(K key, V value)
default ISortedMap<K,V> remove(K key)
default ISortedMap<K,V> forked()
ICollection
If only a single function or scope uses the data structure, it can be left as a linear data structure, which can have significant performance benefits.
If the data structure is already forked, it will simply return itself.
default ISortedMap<K,V> linear()
ICollection
If ICollection.forked()
is called on a linear collection, all references to that linear collection
should be discarded.
If the data structure is already linear, it will simply return itself.
default IDiffSortedMap<K,V> diffSorted()