Package org.h2.mvstore.rtree
Class MVRTreeMap<V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- org.h2.mvstore.MVMap<Spatial,V>
-
- org.h2.mvstore.rtree.MVRTreeMap<V>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMVRTreeMap.Builder<V>A builder for this class.static classMVRTreeMap.RTreeCursor<V>A cursor to iterate over a subset of the keys.-
Nested classes/interfaces inherited from class org.h2.mvstore.MVMap
MVMap.BasicBuilder<M extends MVMap<K,V>,K,V>, MVMap.Decision, MVMap.DecisionMaker<V>, MVMap.MapBuilder<M extends MVMap<K,V>,K,V>
-
-
Constructor Summary
Constructors Constructor Description MVRTreeMap(java.util.Map<java.lang.String,java.lang.Object> config, SpatialDataType keyType, DataType<V> valueType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(Spatial key, V value)Add a given key-value pair.voidaddNodeKeys(java.util.ArrayList<Spatial> list, Page<Spatial,V> p)Add all node keys (including internal bounds) to the given list.MVRTreeMap<V>cloneIt()Clone the current map.MVRTreeMap.RTreeCursor<V>findContainedKeys(Spatial x)Iterate over all keys that are fully contained within the given rectangle.MVRTreeMap.RTreeCursor<V>findIntersectingKeys(Spatial x)Iterate over all keys that have an intersection with the given rectangle.Vget(Page<Spatial,V> p, Spatial key)Get the object for the given key.protected intgetChildPageCount(Page<Spatial,V> p)Get the child page count for this page.java.lang.StringgetType()Get the map type.booleanisQuadraticSplit()Voperate(Spatial key, V value, MVMap.DecisionMaker<V> decisionMaker)Add, replace or remove a key-value pair.Vput(Spatial key, V value)Add or replace a key-value pair.Vremove(java.lang.Object key)Remove a key-value pair, if the key exists.voidsetQuadraticSplit(boolean quadraticSplit)-
Methods inherited from class org.h2.mvstore.MVMap
append, asString, beforeWrite, ceilingKey, clear, containsKey, createEmptyLeaf, createEmptyNode, cursor, cursor, cursor, entrySet, equals, firstKey, floorKey, flushAndGetRoot, get, getId, getKey, getKeyIndex, getKeyType, getName, getRoot, getRootPage, getStore, getValueType, getVersion, hashCode, higherKey, higherKey, isClosed, isEmpty, isPersistent, isReadOnly, isVolatile, keyIterator, keyIteratorReverse, keyList, keySet, lastKey, lowerKey, lowerKey, openVersion, putIfAbsent, registerUnsavedMemory, remove, replace, replace, setVolatile, size, sizeAsLong, toString, trimLast, tryLock, unlockRoot, updateRoot
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Constructor Detail
-
MVRTreeMap
public MVRTreeMap(java.util.Map<java.lang.String,java.lang.Object> config, SpatialDataType keyType, DataType<V> valueType)
-
-
Method Detail
-
cloneIt
public MVRTreeMap<V> cloneIt()
Description copied from class:MVMapClone the current map.
-
findIntersectingKeys
public MVRTreeMap.RTreeCursor<V> findIntersectingKeys(Spatial x)
Iterate over all keys that have an intersection with the given rectangle.- Parameters:
x- the rectangle- Returns:
- the iterator
-
findContainedKeys
public MVRTreeMap.RTreeCursor<V> findContainedKeys(Spatial x)
Iterate over all keys that are fully contained within the given rectangle.- Parameters:
x- the rectangle- Returns:
- the iterator
-
get
public V get(Page<Spatial,V> p, Spatial key)
Get the object for the given key. An exact match is required.
-
remove
public V remove(java.lang.Object key)
Remove a key-value pair, if the key exists.
-
operate
public V operate(Spatial key, V value, MVMap.DecisionMaker<V> decisionMaker)
Description copied from class:MVMapAdd, replace or remove a key-value pair.
-
put
public V put(Spatial key, V value)
Description copied from class:MVMapAdd or replace a key-value pair.
-
add
public void add(Spatial key, V value)
Add a given key-value pair. The key should not exist (if it exists, the result is undefined).- Parameters:
key- the keyvalue- the value
-
addNodeKeys
public void addNodeKeys(java.util.ArrayList<Spatial> list, Page<Spatial,V> p)
Add all node keys (including internal bounds) to the given list. This is mainly used to visualize the internal splits.- Parameters:
list- the listp- the root page
-
isQuadraticSplit
public boolean isQuadraticSplit()
-
setQuadraticSplit
public void setQuadraticSplit(boolean quadraticSplit)
-
getChildPageCount
protected int getChildPageCount(Page<Spatial,V> p)
Description copied from class:MVMapGet the child page count for this page. This is to allow another map implementation to override the default, in case the last child is not to be used.- Overrides:
getChildPageCountin classMVMap<Spatial,V>- Parameters:
p- the page- Returns:
- the number of direct children
-
-