|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
K - Type of the dimensions.E - Type of the dimension bounds.V - Type of the values to store.public interface SpatialValueTree<K,E,V>
A SpatialValueTree is a multidimensional index of values. The data is organized in a fixed number of dimensions, each of which contain a fixed number of nodes. The node of an axis is called a bound. Each node might contain X number of values.
You can think of a SpatialValueTree as a multi dimensional list where collections of values are stored in each possible tuple.
When performing operations on the tree, such as adding values or retrieving
them, we use a SpatialValueTree.SpatialRegion. Each region can cover more than one
bound per dimension.
When evaluating a region, if a dimension is omitted form a region, this means that the region doesn't overlap the dimension at all. It is not the same as covering all the values of the dimension axis.
Example. A tree of years and states containing a X values per leaf node would look something like this:
year:1997
state:NY
value:0x000423
state:FL
value:0x000236
value:0x000423
year:1998
state:NY
value:[EMPTY]
state:FL
value:0x000501
A region key consists of a list of dimensions included in the region along with an array of bounds for each of these dimensions. The boundaries of a given region along a given dimension axis is specified by an array of objects. All of these objects must be nodes of the specified dimension for a region to be valid within a tree context. As an example, the following key:
[ {'year', [1997]}, {'state', ['FL']} ]
... would return { [0x000236] [0x000423] }.
The region keys can have more than one predicate value per axis. If we use the same tree as above, and we query it using the following region key:
... would return { [0x000236] [0x000423] }.
The region key also supports wildcard values. If you want to represent
all of the values of a given axis, you can put a single reference to
SpatialValueTree#AXIS_WILDCARD.
... would return { [0x000236] [0x000423] [0x000501] }.
By convention, implementations are required to compare all generic types
using
[ {'year', [1997]}, {'state', ['NY','FL']} ]
[ {'year', [AXIS_WILDCARD]}, {'state', ['NY','FL']} ]
Object.hashCode() and Object.equals(Object). Users of
this class should also use generic types which implement
Object.hashCode() and Object.equals(Object) to avoid
performance and consistency issues.
Nested Class Summary
static interfaceSpatialValueTree.SpatialRegion<K,E>
Describes a spatial region within a SpatialValueTree.
Field Summary
static ObjectAXIS_WILDCARD
Used as a token to represent all the values of an axis.
Method Summary
voidadd(SpatialValueTree.SpatialRegion<K,E> regionkey,
V value)
Stores a string value at all points which intersect
with the passed region key.
voidclear(SpatialValueTree.SpatialRegion<K,E> regionKey)
Clears all the values found at the provided region
key.
Set<V>get(SpatialValueTree.SpatialRegion<K,E> regionKey)
Looks up all the values registered in nodes intersecting
with the provided region key.
intgetDimensionality()
Tells the number of dimensions in this tree.
List<K>getDimensions()
Returns a list of all the dimensions present in this tree.
Set<V>match(SpatialValueTree.SpatialRegion<K,E> regionKey)
Looks up all the values registered in nodes intersecting
with the provided region key.
Field Detail
AXIS_WILDCARD
static final Object AXIS_WILDCARD
Object.equals(Object) and
Object.hashCode() so that only identity comparison
are used.
Method Detail
add
void add(SpatialValueTree.SpatialRegion<K,E> regionkey,
V value)
clear
void clear(SpatialValueTree.SpatialRegion<K,E> regionKey)
regionKey - The region key of the values to clear.
get
Set<V> get(SpatialValueTree.SpatialRegion<K,E> regionKey)
regionKey - The region key inside of which to search for
value nodes.
match
Set<V> match(SpatialValueTree.SpatialRegion<K,E> regionKey)
regionKey - The region key inside of which to search for
value nodes.
getDimensions
List<K> getDimensions()
getDimensionality
int getDimensionality()
Overview
Package
Class
Tree
Deprecated
Index
Help
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD