T - public class QuadTreeKD0<T> extends Object implements PointIndex<T>
| Modifier and Type | Class and Description |
|---|---|
static class |
QuadTreeKD0.QIterator<T>
Resettable query iterator.
|
static class |
QuadTreeKD0.QStats
Statistics container class.
|
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEBUG |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Removes all elements from the tree.
|
boolean |
containsExact(double[] key)
Check whether a given key exists.
|
static <T> QuadTreeKD0<T> |
create(int dims) |
static <T> QuadTreeKD0<T> |
create(int dims,
int maxNodeSize) |
static <T> QuadTreeKD0<T> |
create(int dims,
int maxNodeSize,
double[] center,
double radius) |
int |
getDepth() |
int |
getDims() |
int |
getNodeCount() |
QuadTreeKD0.QStats |
getStats() |
void |
insert(double[] key,
T value)
Insert a key-value pair.
|
QueryIterator<PointEntry<T>> |
iterator() |
List<QEntryDist<T>> |
knnQuery(double[] center,
int k) |
QuadTreeKD0.QIterator<T> |
query(double[] min,
double[] max)
Query the tree, returning all points in the axis-aligned rectangle between 'min' and 'max'.
|
T |
queryExact(double[] key)
Get the value associates with the key.
|
org.tinspin.index.qtplain.QuadTreeKD0.QQueryIteratorKNN |
queryKNN(double[] center,
int k)
Finds the nearest neighbor.
|
T |
remove(double[] key)
Remove a key.
|
int |
size()
Get the number of key-value pairs in the tree.
|
String |
toString() |
String |
toStringTree()
Returns a printable list of the tree.
|
T |
update(double[] oldKey,
double[] newKey)
Reinsert the key.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitquery1NNpublic static final boolean DEBUG
public static <T> QuadTreeKD0<T> create(int dims)
public static <T> QuadTreeKD0<T> create(int dims, int maxNodeSize)
public static <T> QuadTreeKD0<T> create(int dims, int maxNodeSize, double[] center, double radius)
public void insert(double[] key,
T value)
insert in interface PointIndex<T>key - the keyvalue - the valuepublic boolean containsExact(double[] key)
key - the key to checkpublic T queryExact(double[] key)
queryExact in interface PointIndex<T>key - the key to look uppublic T remove(double[] key)
remove in interface PointIndex<T>key - key to removepublic T update(double[] oldKey, double[] newKey)
update in interface PointIndex<T>oldKey - old keynewKey - new keypublic int size()
public void clear()
public QuadTreeKD0.QIterator<T> query(double[] min, double[] max)
query in interface PointIndex<T>min - lower left corner of querymax - upper right corner of querypublic List<QEntryDist<T>> knnQuery(double[] center, int k)
public String toStringTree()
toStringTree in interface Index<T>public QuadTreeKD0.QStats getStats()
public int getDims()
public QueryIterator<PointEntry<T>> iterator()
iterator in interface PointIndex<T>public org.tinspin.index.qtplain.QuadTreeKD0.QQueryIteratorKNN queryKNN(double[] center,
int k)
PointIndexqueryKNN in interface PointIndex<T>center - center pointk - number of neighborspublic int getNodeCount()
getNodeCount in interface Index<T>Copyright © 2017. All rights reserved.