public class CritBit64<V> extends Object implements Iterable<V>
| Modifier and Type | Class and Description |
|---|---|
protected static class |
CritBit64.AtomicInfo<V> |
static class |
CritBit64.CBIterator<V> |
static class |
CritBit64.Entry<V> |
protected static class |
CritBit64.Node<V> |
static class |
CritBit64.QueryIterator<V> |
static class |
CritBit64.QueryIteratorMask<V> |
| Modifier and Type | Field and Description |
|---|---|
protected static int |
DEPTH |
protected CritBit64.AtomicInfo<V> |
info |
| Modifier | Constructor and Description |
|---|---|
protected |
CritBit64() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkTree() |
boolean |
contains(long key)
Check whether a given key exists in the tree.
|
static <V> CritBit64<V> |
create()
Create a 1D crit-bit tree with 64 bit key length.
|
V |
get(long key)
Get the value for a given key.
|
CritBit64.CBIterator<V> |
iterator() |
void |
printTree() |
V |
put(long key,
V val)
Add a key value pair to the tree or replace the value if the key already exists.
|
CritBit64.QueryIterator<V> |
query(long min,
long max)
Queries the tree for entries with
min<=key<=max. |
CritBit64.QueryIteratorMask<V> |
queryWithMask(long min,
long max)
Queries the tree for entries with
min<=key<=max. |
V |
remove(long key)
Remove a key and its value
|
int |
size()
Get the size of the tree.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorprotected static final int DEPTH
protected CritBit64.AtomicInfo<V> info
public static <V> CritBit64<V> create()
V - value typepublic V put(long key, V val)
key - keyval - valuenull if there was no previous valuepublic void printTree()
public boolean checkTree()
public int size()
public boolean contains(long key)
key - keytrue if the key exists otherwise falsepublic V get(long key)
key - keykey or null if the key does not exist.public V remove(long key)
key - keynull if the value was not found.public CritBit64.CBIterator<V> iterator()
public CritBit64.QueryIterator<V> query(long min, long max)
min<=key<=max.min - minimum keymax - maximum keypublic CritBit64.QueryIteratorMask<V> queryWithMask(long min, long max)
min<=key<=max. Unlike the normal query, this
query also excludes all elements with (key|min)!=key and (key&max!=max).
See PH-Tree for a discussion.min - minimum keymax - maximum keyCopyright © 2017. All rights reserved.