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 TypeMethodDescriptionvoidclear()cleared()clone()Comparator<? super K>booleancontainsKey(Object key) booleancontainsValue(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()booleanfirstKey()static <K,V, U> BTreeMap<K, V, U> getIndex(int index) inthashCode()intbooleanisEmpty()iterator()lastKey()previousEntry(K key) previousKey(K key) previousValue(K key) voidreduced(U identity, CombinerFunction<? super V, U> accumulator, CombinerFunction<U, U> combiner) Returns the reduction of thisReducedMap, combining all contained elements with the givenaccumulatorandcombinerfunctions, recomputing only what has changed since the last invocation ofreduced.intsize()snapshot()An immutable copy of thisBTreeMap's data.take(int upper) toString()Methods inherited from class swim.collections.BTreeContext
compareKey, pageShouldMerge, pageShouldSplit, pageSplitSizeMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods 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:
containsKeyin interfaceIterableMap<K,V> - Specified by:
containsKeyin interfaceMap<K,V> - Specified by:
containsKeyin interfaceOrderedMap<K,V>
-
containsValue
- Specified by:
containsValuein interfaceIterableMap<K,V> - Specified by:
containsValuein interfaceMap<K,V> - Specified by:
containsValuein interfaceOrderedMap<K,V>
-
indexOf
- Specified by:
indexOfin interfaceOrderedMap<K,V>
-
get
-
getEntry
- Specified by:
getEntryin interfaceOrderedMap<K,V>
-
getIndex
- Specified by:
getIndexin interfaceOrderedMap<K,V>
-
firstEntry
- Specified by:
firstEntryin interfaceOrderedMap<K,V>
-
firstKey
-
firstValue
- Specified by:
firstValuein interfaceOrderedMap<K,V>
-
lastEntry
- Specified by:
lastEntryin interfaceOrderedMap<K,V>
-
lastKey
-
lastValue
- Specified by:
lastValuein interfaceOrderedMap<K,V>
-
nextEntry
- Specified by:
nextEntryin interfaceOrderedMap<K,V>
-
nextKey
- Specified by:
nextKeyin interfaceOrderedMap<K,V>
-
nextValue
- Specified by:
nextValuein interfaceOrderedMap<K,V>
-
previousEntry
- Specified by:
previousEntryin interfaceOrderedMap<K,V>
-
previousKey
- Specified by:
previousKeyin interfaceOrderedMap<K,V>
-
previousValue
- Specified by:
previousValuein 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:ReducedMapReturns the reduction of thisReducedMap, combining all contained elements with the givenaccumulatorandcombinerfunctions, recomputing only what has changed since the last invocation ofreduced. Stores partial computations to accelerate repeated reduction of continuously mutating datasets.- Specified by:
reducedin interfaceReducedMap<K,V, U>
-
snapshot
An immutable copy of thisBTreeMap's data. -
iterator
-
keyIterator
- Specified by:
keyIteratorin interfaceIterableMap<K,V> - Specified by:
keyIteratorin interfaceOrderedMap<K,V>
-
valueIterator
- Specified by:
valueIteratorin interfaceIterableMap<K,V> - Specified by:
valueIteratorin interfaceOrderedMap<K,V>
-
reverseIterator
-
reverseKeyIterator
-
reverseValueIterator
-
clone
-
copy
-
comparator
- Specified by:
comparatorin interfaceOrderedMap<K,V> - Specified by:
comparatorin interfaceSortedMap<K,V>
-
equals
-
hashCode
public int hashCode() -
debug
Description copied from interface:DebugWrites a developer readable, debug-formatted string representation of this object tooutput. -
toString
-
empty
-
from
-