public class NBPlusTreeImpl<K extends Comparable<K>,V> extends AbstractMap<K,V> implements NBPlusTree<K,V>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>NBPlusTree.IntermediateNode<K extends Comparable<K>,V>, NBPlusTree.LeafNode<K extends Comparable<K>,V>, NBPlusTree.Node<K extends Comparable<K>,V>, NBPlusTree.Visitor<K extends Comparable<K>,V>| Constructor and Description |
|---|
NBPlusTreeImpl(NBPlusTreeStore<K,V> store) |
| Modifier and Type | Method and Description |
|---|---|
V |
add(K key,
V value,
boolean allowDuplicate) |
void |
close() |
V |
computeIfAbsent(K key,
Function<? super K,? extends V> mappingFunction) |
void |
dump() |
void |
dump(PrintStream out) |
Iterator<Map.Entry<K,V>> |
entryIterator() |
Set<Map.Entry<K,V>> |
entrySet() |
V |
get(K key) |
NOptional<V> |
getOptional(K key) |
boolean |
isEmpty()
This is a simple method that determines if the B+ tree is empty or not.
|
Iterator<K> |
keyIterator() |
static <K extends Comparable<K>,V> |
of(int m) |
static <K extends Comparable<K>,V> |
of(int m,
boolean allowDuplicates) |
V |
put(K key,
V value)
Given an integer key and floating point value, this method inserts a
dictionary pair accordingly into the B+ tree.
|
V |
putIfAbsent(K key,
V value) |
boolean |
remove(K key)
Given a key, this method will remove the dictionary pair with the
corresponding key from the B+ tree.
|
List<V> |
search(K key) |
List<V> |
search(K lowerBound,
K upperBound)
This method traverses the doubly linked list of the B+ tree and records
all values whose associated keys are within the range specified by
lowerBound and upperBound.
|
int |
size() |
long |
sizeLong() |
void |
visit(NBPlusTree.Visitor<K,V> visitor) |
clear, clone, containsKey, containsValue, equals, get, hashCode, keySet, putAll, remove, toString, valuesfinalize, getClass, notify, notifyAll, wait, wait, waitclear, compute, computeIfPresent, containsKey, containsValue, equals, forEach, get, getOrDefault, hashCode, keySet, merge, putAll, remove, remove, replace, replace, replaceAll, valuespublic NBPlusTreeImpl(NBPlusTreeStore<K,V> store)
public static <K extends Comparable<K>,V> NBPlusTreeImpl<K,V> of(int m, boolean allowDuplicates)
of in interface NBPlusTree<K extends Comparable<K>,V>public static <K extends Comparable<K>,V> NBPlusTreeImpl<K,V> of(int m)
of in interface NBPlusTree<K extends Comparable<K>,V>public boolean isEmpty()
isEmpty in interface Map<K extends Comparable<K>,V>isEmpty in class AbstractMap<K extends Comparable<K>,V>public int size()
size in interface Map<K extends Comparable<K>,V>size in class AbstractMap<K extends Comparable<K>,V>public long sizeLong()
sizeLong in interface NBPlusTree<K extends Comparable<K>,V>public boolean remove(K key)
remove in interface NBPlusTree<K extends Comparable<K>,V>key: - an integer key that corresponds with an existing dictionary
pairpublic V put(K key, V value)
put in interface Map<K extends Comparable<K>,V>put in class AbstractMap<K extends Comparable<K>,V>key: - an integer key to be used in the dictionary pairvalue: - a floating point number to be used in the dictionary pairpublic V putIfAbsent(K key, V value)
putIfAbsent in interface Map<K extends Comparable<K>,V>public V computeIfAbsent(K key, Function<? super K,? extends V> mappingFunction)
computeIfAbsent in interface Map<K extends Comparable<K>,V>public Set<Map.Entry<K,V>> entrySet()
entrySet in interface Map<K extends Comparable<K>,V>entrySet in class AbstractMap<K extends Comparable<K>,V>public V add(K key, V value, boolean allowDuplicate)
add in interface NBPlusTree<K extends Comparable<K>,V>public Iterator<Map.Entry<K,V>> entryIterator()
entryIterator in interface NBPlusTree<K extends Comparable<K>,V>public Iterator<K> keyIterator()
keyIterator in interface NBPlusTree<K extends Comparable<K>,V>public List<V> search(K key)
search in interface NBPlusTree<K extends Comparable<K>,V>public V get(K key)
get in interface NBPlusTree<K extends Comparable<K>,V>public NOptional<V> getOptional(K key)
getOptional in interface NBPlusTree<K extends Comparable<K>,V>public List<V> search(K lowerBound, K upperBound)
search in interface NBPlusTree<K extends Comparable<K>,V>lowerBound: - (int) the lower bound of the rangeupperBound: - (int) the upper bound of the rangepublic void dump()
public void dump(PrintStream out)
public void visit(NBPlusTree.Visitor<K,V> visitor)
visit in interface NBPlusTree<K extends Comparable<K>,V>public void close()
close in interface AutoCloseableclose in interface NBPlusTree<K extends Comparable<K>,V>Copyright © 2026 vpc open source initiative. All rights reserved.