java.lang.Object
swim.collections.BTreeContext<K,V>
swim.collections.BTreeMap<K,V,U>
- All Implemented Interfaces:
Cloneable
,Iterable<Map.Entry<K,
,V>> Map<K,
,V> SortedMap<K,
,V> Debug
,IterableMap<K,
,V> OrderedMap<K,
,V> ReducedMap<K,
V, U>
public class BTreeMap<K,V,U>
extends BTreeContext<K,V>
implements ReducedMap<K,V,U>, Cloneable, Debug
Mutable, thread-safe
Map
backed by a B-tree.-
Nested Class Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
cleared()
clone()
Comparator<? super K>
boolean
containsKey
(Object key) boolean
containsValue
(Object value) <T> Output<T>
Writes a developer readable, debug-formatted string representation of this object tooutput
.drop
(int lower) static <K,
V, U> BTreeMap<K, V, U> empty()
boolean
firstKey()
static <K,
V, U> BTreeMap<K, V, U> getIndex
(int index) int
hashCode()
int
boolean
isEmpty()
iterator()
lastKey()
previousEntry
(K key) previousKey
(K key) previousValue
(K key) void
reduced
(U identity, CombinerFunction<? super V, U> accumulator, CombinerFunction<U, U> combiner) Returns the reduction of thisReducedMap
, combining all contained elements with the givenaccumulator
andcombiner
functions, recomputing only what has changed since the last invocation ofreduced
.int
size()
snapshot()
An immutable copy of thisBTreeMap
's data.take
(int upper) toString()
Methods inherited from class swim.collections.BTreeContext
compareKey, pageShouldMerge, pageShouldSplit, pageSplitSize
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
BTreeMap
-
BTreeMap
public BTreeMap()
-
-
Method Details
-
isEmpty
public boolean isEmpty() -
size
public int size() -
containsKey
- Specified by:
containsKey
in interfaceIterableMap<K,
V> - Specified by:
containsKey
in interfaceMap<K,
V> - Specified by:
containsKey
in interfaceOrderedMap<K,
V>
-
containsValue
- Specified by:
containsValue
in interfaceIterableMap<K,
V> - Specified by:
containsValue
in interfaceMap<K,
V> - Specified by:
containsValue
in interfaceOrderedMap<K,
V>
-
indexOf
- Specified by:
indexOf
in interfaceOrderedMap<K,
V>
-
get
-
getEntry
- Specified by:
getEntry
in interfaceOrderedMap<K,
V>
-
getIndex
- Specified by:
getIndex
in interfaceOrderedMap<K,
V>
-
firstEntry
- Specified by:
firstEntry
in interfaceOrderedMap<K,
V>
-
firstKey
-
firstValue
- Specified by:
firstValue
in interfaceOrderedMap<K,
V>
-
lastEntry
- Specified by:
lastEntry
in interfaceOrderedMap<K,
V>
-
lastKey
-
lastValue
- Specified by:
lastValue
in interfaceOrderedMap<K,
V>
-
nextEntry
- Specified by:
nextEntry
in interfaceOrderedMap<K,
V>
-
nextKey
- Specified by:
nextKey
in interfaceOrderedMap<K,
V>
-
nextValue
- Specified by:
nextValue
in interfaceOrderedMap<K,
V>
-
previousEntry
- Specified by:
previousEntry
in interfaceOrderedMap<K,
V>
-
previousKey
- Specified by:
previousKey
in interfaceOrderedMap<K,
V>
-
previousValue
- Specified by:
previousValue
in interfaceOrderedMap<K,
V>
-
put
-
putAll
-
remove
-
drop
-
take
-
clear
public void clear() -
updated
-
removed
-
cleared
-
reduced
public U reduced(U identity, CombinerFunction<? super V, U> accumulator, CombinerFunction<U, U> combiner) Description copied from interface:ReducedMap
Returns the reduction of thisReducedMap
, combining all contained elements with the givenaccumulator
andcombiner
functions, recomputing only what has changed since the last invocation ofreduced
. Stores partial computations to accelerate repeated reduction of continuously mutating datasets.- Specified by:
reduced
in interfaceReducedMap<K,
V, U>
-
snapshot
An immutable copy of thisBTreeMap
's data. -
iterator
-
keyIterator
- Specified by:
keyIterator
in interfaceIterableMap<K,
V> - Specified by:
keyIterator
in interfaceOrderedMap<K,
V>
-
valueIterator
- Specified by:
valueIterator
in interfaceIterableMap<K,
V> - Specified by:
valueIterator
in interfaceOrderedMap<K,
V>
-
reverseIterator
-
reverseKeyIterator
-
reverseValueIterator
-
clone
-
copy
-
comparator
- Specified by:
comparator
in interfaceOrderedMap<K,
V> - Specified by:
comparator
in interfaceSortedMap<K,
V>
-
equals
-
hashCode
public int hashCode() -
debug
Description copied from interface:Debug
Writes a developer readable, debug-formatted string representation of this object tooutput
. -
toString
-
empty
-
from
-