- 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>,swim.codec.Debug,swim.util.IterableMap<K,V>,swim.util.OrderedMap<K,V>,swim.util.ReducedMap<K,V,U>
public class BTreeMap<K,V,U> extends BTreeContext<K,V> implements swim.util.ReducedMap<K,V,U>, Cloneable, swim.codec.Debug
Mutable, thread-safeMapbacked by a B-tree.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()BTreeMap<K,V,U>cleared()BTreeMap<K,V,U>clone()Comparator<? super K>comparator()booleancontainsKey(Object key)booleancontainsValue(Object value)protected BTreeMap<K,V,U>copy(BTreePage<K,V,U> root)voiddebug(swim.codec.Output<?> output)BTreeMap<K,V,U>drop(int lower)static <K,V,U>
BTreeMap<K,V,U>empty()booleanequals(Object other)Map.Entry<K,V>firstEntry()KfirstKey()VfirstValue()static <K,V,U>
BTreeMap<K,V,U>from(Map<? extends K,? extends V> map)Vget(Object key)Map.Entry<K,V>getEntry(Object key)Map.Entry<K,V>getIndex(int index)inthashCode()intindexOf(Object key)booleanisEmpty()swim.util.OrderedMapCursor<K,V>iterator()swim.util.Cursor<K>keyIterator()Map.Entry<K,V>lastEntry()swim.util.OrderedMapCursor<K,V>lastIterator()KlastKey()swim.util.Cursor<K>lastKeyIterator()VlastValue()swim.util.Cursor<V>lastValueIterator()Map.Entry<K,V>nextEntry(K key)KnextKey(K key)VnextValue(K key)static <K,V,U>
BTreeMap<K,V,U>of(K key, V value)Map.Entry<K,V>previousEntry(K key)KpreviousKey(K key)VpreviousValue(K key)Vput(K key, V newValue)voidputAll(Map<? extends K,? extends V> map)Ureduced(U identity, swim.util.CombinerFunction<? super V,U> accumulator, swim.util.CombinerFunction<U,U> combiner)Vremove(Object key)BTreeMap<K,V,U>removed(K key)intsize()BTree<K,V>snapshot()An immutable copy of thisBTreeMap's data.BTreeMap<K,V,U>take(int upper)StringtoString()BTreeMap<K,V,U>updated(K key, V newValue)swim.util.Cursor<V>valueIterator()-
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
-
-
-
-
Method Detail
-
empty
public static <K,V,U> BTreeMap<K,V,U> empty()
-
of
public static <K,V,U> BTreeMap<K,V,U> of(K key, V value)
-
isEmpty
public boolean isEmpty()
-
size
public int size()
-
containsKey
public boolean containsKey(Object key)
-
containsValue
public boolean containsValue(Object value)
-
indexOf
public int indexOf(Object key)
-
firstKey
public K firstKey()
-
lastKey
public K lastKey()
-
clear
public void clear()
-
reduced
public U reduced(U identity, swim.util.CombinerFunction<? super V,U> accumulator, swim.util.CombinerFunction<U,U> combiner)
-
keyIterator
public swim.util.Cursor<K> keyIterator()
-
valueIterator
public swim.util.Cursor<V> valueIterator()
-
lastKeyIterator
public swim.util.Cursor<K> lastKeyIterator()
-
lastValueIterator
public swim.util.Cursor<V> lastValueIterator()
-
comparator
public Comparator<? super K> comparator()
-
equals
public boolean equals(Object other)
-
hashCode
public int hashCode()
-
debug
public void debug(swim.codec.Output<?> output)
- Specified by:
debugin interfaceswim.codec.Debug
-
-