Package org.tinspin.index.phtree
Class PHTreeR<T>
- java.lang.Object
-
- org.tinspin.index.phtree.PHTreeR<T>
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.tinspin.index.BoxMap
BoxMap.Factory
-
Nested classes/interfaces inherited from interface org.tinspin.index.Index
Index.BEComparator, Index.BoxEntry<T>, Index.BoxEntryKnn<T>, Index.BoxFilterKnn<T>, Index.BoxIterator<T>, Index.BoxIteratorKnn<T>, Index.PEComparator, Index.PointEntry<T>, Index.PointEntryKnn<T>, Index.PointFilterKnn<T>, Index.PointIterator<T>, Index.PointIteratorKnn<T>, Index.QueryIterator<T>, Index.QueryIteratorKnn<T>
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclear()Clear all entries.booleancontains(double[] min, double[] max)Lookup an entry, using exact match.static <T> PHTreeR<T>createPHTree(int dims)intgetDepth()intgetDims()intgetNodeCount()PHStatsgetStats()voidinsert(double[] lower, double[] upper, T value)Insert a box.Index.BoxIterator<T>iterator()TqueryExact(double[] lower, double[] upper)Lookup an entry, using exact match.Index.BoxIterator<T>queryIntersect(double[] min, double[] max)Index.BoxIteratorKnn<T>queryKnn(double[] center, int k)Finds the nearest neighbor.Tremove(double[] lower, double[] upper)Remove an entry.intsize()StringtoStringTree()Tupdate(double[] lo1, double[] up1, double[] lo2, double[] up2)Update the position of an entry.
-
-
-
Method Detail
-
createPHTree
public static <T> PHTreeR<T> createPHTree(int dims)
-
getDims
public int getDims()
-
clear
public void clear()
Description copied from interface:IndexClear all entries.
-
getStats
public PHStats getStats()
-
getNodeCount
public int getNodeCount()
- Specified by:
getNodeCountin interfaceIndex
-
toStringTree
public String toStringTree()
- Specified by:
toStringTreein interfaceIndex- Returns:
- a full string output of the tree structure with all entries
-
insert
public void insert(double[] lower, double[] upper, T value)Description copied from interface:BoxMapInsert a box.
-
remove
public T remove(double[] lower, double[] upper)
Description copied from interface:BoxMapRemove an entry.
-
update
public T update(double[] lo1, double[] up1, double[] lo2, double[] up2)
Description copied from interface:BoxMapUpdate the position of an entry.
-
contains
public boolean contains(double[] min, double[] max)Description copied from interface:BoxMapLookup an entry, using exact match.
-
queryExact
public T queryExact(double[] lower, double[] upper)
Description copied from interface:BoxMapLookup an entry, using exact match.- Specified by:
queryExactin interfaceBoxMap<T>- Parameters:
lower- minimum cornerupper- maximum corner- Returns:
- the value of the entry or null if the entry was not found
-
iterator
public Index.BoxIterator<T> iterator()
-
queryIntersect
public Index.BoxIterator<T> queryIntersect(double[] min, double[] max)
- Specified by:
queryIntersectin interfaceBoxMap<T>- Parameters:
min- Lower left corner of the query windowmax- Upper right corner of the query window- Returns:
- All boxes that intersect with the query rectangle.
-
queryKnn
public Index.BoxIteratorKnn<T> queryKnn(double[] center, int k)
Description copied from interface:BoxMapFinds the nearest neighbor. This uses Euclidean 'edge distance', i.e. the distance to the edge of a box. Distance is 0 if the box overlaps with the search point. Other distance types can only be specified directly on the index implementations.
-
-