public class ConcatSortedMap<K,V> extends ISortedMap.Mixin<K,V> implements IDiffSortedMap<K,V>
IDiffSortedMap.Durable<K,V>
ISortedMap.Mixin<K,V>
hash
Modifier and Type | Method and Description |
---|---|
ConcatSortedMap<K,V> |
clone() |
Comparator<K> |
comparator() |
ConcatSortedMap<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.
|
static <K,V> ConcatSortedMap<K,V> |
from(ISortedMap<K,V> underlying) |
static <K,V> ConcatSortedMap<K,V> |
from(ISortedMap<K,V> underlying,
IList<ISortedMap<K,V>> segments) |
static <K,V> ConcatSortedMap<K,V> |
from(ISortedMap<K,V> underlying,
ISortedMap<K,V>... segments) |
boolean |
isLinear() |
ConcatSortedMap<K,V> |
linear()
This returns a data structure which is linear, or temporarily mutable.
|
ConcatSortedMap<K,V> |
put(K key,
V value,
BinaryOperator<V> merge) |
ConcatSortedMap<K,V> |
rebase(ISortedMap<K,V> newUnderlying)
Returns a new diff, which is rebased atop the new underlying collection.
|
ConcatSortedMap<K,V> |
remove(K key) |
ISortedSet<Long> |
segmentOffsets() |
ISortedMap<K,ISortedMap<K,V>> |
segments() |
ConcatSortedMap<K,V> |
slice(K min,
K max) |
ISortedMap<K,V> |
underlying()
The underlying collection
|
equals, hashCode, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
inclusiveFloorIndex, iterator, nth, size
ceil, ceil, ceilIndex, ceilIndex, difference, difference, diffSorted, first, floor, floor, floorIndex, floorIndex, indexOf, intersection, keyEquality, keyHash, keys, last, merge, put, slice, sliceIndices, union, update
apply, contains, containsAll, containsAll, containsAny, containsAny, diff, entries, equals, get, get, getOrCreate, hashSortedEntries, intersection, iterator, mapValues, save, split, spliterator, stream, toMap, values
nth
public static <K,V> ConcatSortedMap<K,V> from(ISortedMap<K,V> underlying)
public static <K,V> ConcatSortedMap<K,V> from(ISortedMap<K,V> underlying, ISortedMap<K,V>... segments)
public static <K,V> ConcatSortedMap<K,V> from(ISortedMap<K,V> underlying, IList<ISortedMap<K,V>> segments)
public ISortedMap<K,V> underlying()
IDiff
underlying
in interface IDiff<ISortedMap<K,V>>
underlying
in interface IDiffSortedMap<K,V>
public Comparator<K> comparator()
comparator
in interface IDiffSortedMap<K,V>
comparator
in interface ISortedMap<K,V>
public ISortedMap<K,ISortedMap<K,V>> segments()
segments
in interface IDiffSortedMap<K,V>
public ISortedSet<Long> segmentOffsets()
segmentOffsets
in interface IDiffSortedMap<K,V>
public ConcatSortedMap<K,V> rebase(ISortedMap<K,V> newUnderlying)
IDiff
a.rebase(b).rebase(c)
is not necessarily equivalent to a.rebase(c)
.rebase
in interface IDiff<ISortedMap<K,V>>
rebase
in interface IDiffSortedMap<K,V>
public ConcatSortedMap<K,V> put(K key, V value, BinaryOperator<V> merge)
put
in interface IMap<K,V>
put
in interface ISortedMap<K,V>
merge
- a function which will be invoked if there is a pre-existing value under key
, with the current
value as the first argument and new value as the second, to determine the combined resultvalue
under key
public ConcatSortedMap<K,V> remove(K key)
public ConcatSortedMap<K,V> slice(K min, K max)
slice
in interface ISortedMap<K,V>
min
- the inclusive minimum key valuemax
- the inclusive maximum key valuepublic ConcatSortedMap<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.
public ConcatSortedMap<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.
public boolean isLinear()
public ConcatSortedMap<K,V> clone()