Package org.h2.mvstore.rtree
Class MVRTreeMap<V>
- Type Parameters:
V
- the value class
- All Implemented Interfaces:
ConcurrentMap<Spatial,
,V> Map<Spatial,
V>
An r-tree implementation. It supports both the linear and the quadratic split
algorithm.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A builder for this class.private static final class
private static final class
static class
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> Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,
V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final SpatialDataType
The spatial key type.private boolean
-
Constructor Summary
ConstructorsModifierConstructorDescriptionMVRTreeMap
(Map<String, Object> config, SpatialDataType keyType, DataType<V> valueType) private
MVRTreeMap
(MVRTreeMap<V> source) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a given key-value pair.void
Add all node keys (including internal bounds) to the given list.cloneIt()
Clone the current map.private boolean
Iterate over all keys that are fully contained within the given rectangle.Iterate over all keys that have an intersection with the given rectangle.Get the object for the given key.private Spatial
protected int
Get the child page count for this page.getType()
Get the map type.boolean
private static <V> void
newPage
(boolean leaf) private V
operate
(Page<Spatial, V> p, Spatial key, V value, MVMap.DecisionMaker<? super V> decisionMaker, Collection<Page<Spatial, V>> removedPages) operate
(Spatial key, V value, MVMap.DecisionMaker<? super V> decisionMaker) Add, replace or remove a key-value pair.Add or replace a key-value pair.Remove a key-value pair, if the key exists.void
setQuadraticSplit
(boolean quadraticSplit) splitLinear
(Page<Spatial, V> p) splitQuadratic
(Page<Spatial, V> p) 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, remove, replace, replace, setVolatile, size, sizeAsLong, toString, trimLast, tryLock, unlockRoot, updateRoot
Methods inherited from class java.util.AbstractMap
clone, containsValue, putAll, values
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.concurrent.ConcurrentMap
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, replaceAll
Methods inherited from interface java.util.Map
containsValue, putAll, values
-
Field Details
-
keyType
The spatial key type. -
quadraticSplit
private boolean quadraticSplit
-
-
Constructor Details
-
MVRTreeMap
-
MVRTreeMap
-
-
Method Details
-
cloneIt
Description copied from class:MVMap
Clone the current map. -
findIntersectingKeys
Iterate over all keys that have an intersection with the given rectangle.- Parameters:
x
- the rectangle- Returns:
- the iterator
-
findContainedKeys
Iterate over all keys that are fully contained within the given rectangle.- Parameters:
x
- the rectangle- Returns:
- the iterator
-
contains
-
get
Get the object for the given key. An exact match is required. -
remove
Remove a key-value pair, if the key exists. -
operate
Description copied from class:MVMap
Add, replace or remove a key-value pair. -
operate
-
getBounds
-
put
Description copied from class:MVMap
Add or replace a key-value pair. -
add
Add a given key-value pair. The key should not exist (if it exists, the result is undefined).- Parameters:
key
- the keyvalue
- the value
-
split
-
splitLinear
-
splitQuadratic
-
newPage
-
move
-
addNodeKeys
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
Description copied from class:MVMap
Get 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:
getChildPageCount
in classMVMap<Spatial,
V> - Parameters:
p
- the page- Returns:
- the number of direct children
-
getType
Description copied from class:MVMap
Get the map type. When opening an existing map, the map type must match.
-