- java.lang.Object
-
- swim.collections.BTreeContext<K,V>
-
- swim.collections.BTree<K,V>
-
- All Implemented Interfaces:
Iterable<Map.Entry<K,V>>,Map<K,V>,SortedMap<K,V>,swim.codec.Debug,swim.util.IterableMap<K,V>,swim.util.OrderedMap<K,V>
public class BTree<K,V> extends BTreeContext<K,V> implements swim.util.OrderedMap<K,V>, swim.codec.Debug
ImmutableOrderedMapbacked by a B-tree.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()BTree<K,V>cleared()Comparator<? super K>comparator()booleancontainsKey(Object key)booleancontainsValue(Object value)protected BTree<K,V>copy(BTreePage<K,V,?> root)voiddebug(swim.codec.Output<?> output)BTree<K,V>drop(int lower)static <K,V>
BTree<K,V>empty()booleanequals(Object other)Map.Entry<K,V>firstEntry()KfirstKey()VfirstValue()static <K,V>
BTree<K,V>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>
BTree<K,V>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)Vremove(Object key)BTree<K,V>removed(K key)intsize()BTree<K,V>take(int upper)StringtoString()BTree<K,V>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
clone, 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
-
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()
-
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
-
empty
public static <K,V> BTree<K,V> empty()
-
of
public static <K,V> BTree<K,V> of(K key, V value)
-
-