Package org.tinspin.index.critbit
Class CritBit64COW<V>
- java.lang.Object
-
- org.tinspin.index.critbit.CritBit64<V>
-
- org.tinspin.index.critbit.CritBit64COW<V>
-
- Type Parameters:
V- value type
- All Implemented Interfaces:
Iterable<V>
public class CritBit64COW<V> extends CritBit64<V> implements Iterable<V>
A concurrency enabled version of the CritBit64 tree. The implementation uses copy-on-write concurrency, therefore locking occurs only during updates, read-access is never locked. Currently write/update access is limited to one thread at a time. Read access guarantees full snapshot consistency for all read access including iterators. Version 1.3.4 - CB64COW is now a sub-class of CB64 Version 1.3.3 - Fixed 64COW iterators returning empty Entry for queries that shouldn't return anything. Version 1.3.2 - Improved mask checking in QueryWithMask Version 1.3.1 - Fixed issue #3 where iterators won't work with 'null' as values. Version 1.0: initial implementation- Author:
- bvancea
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.tinspin.index.critbit.CritBit64
CritBit64.AtomicInfo<V>, CritBit64.CBIterator<V>, CritBit64.Entry<V>, CritBit64.Node<V>, CritBit64.QueryIterator<V>, CritBit64.QueryIteratorMask<V>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancheckTree()booleancontains(long key)Check whether a given key exists in the tree.CritBit64COW<V>copy()static <V> CritBit64COW<V>create()Create a 1D crit-bit tree with 64 bit key length.Vget(long key)Get the value for a given key.voidprintTree()Vput(long key, V val)Add a key value pair to the tree or replace the value if the key already exists.Vremove(long key)Remove a key and its valueintsize()Get the size of the tree.StringtoString()-
Methods inherited from class org.tinspin.index.critbit.CritBit64
iterator, query, queryWithMask
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
-
-
-
Method Detail
-
create
public static <V> CritBit64COW<V> create()
Create a 1D crit-bit tree with 64 bit key length.- Type Parameters:
V- value type- Returns:
- a 1D crit-bit tree
-
copy
public CritBit64COW<V> copy()
-
put
public V put(long key, V val)
Add a key value pair to the tree or replace the value if the key already exists.
-
size
public int size()
Get the size of the tree.
-
contains
public boolean contains(long key)
Check whether a given key exists in the tree.
-
get
public V get(long key)
Get the value for a given key.
-
-