Class RTree<T>
- java.lang.Object
-
- org.jungrapht.visualization.spatial.rtree.RTree<T>
-
public class RTree<T> extends Object
R-Tree or R*-Tree implementation, depending on the type of Splitters passed in the SplitterContextBased on The R*-tree: An Efficient and Robust Access Method for Points and Rectangles+ Norbert Beckmann, Hans-Peter begel, Ralf Schneider, Bernhard Seeger Praktuche Informatlk, Umversltaet Bremen, D-2800 Bremen 33, West Germany
- Author:
- Tom Nelson
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> RTree<T>
add(RTree<T> rtree, SplitterContext<T> splitterContext, Map.Entry<T,Rectangle2D> entry)
static <T> RTree<T>
add(RTree<T> rtree, SplitterContext<T> splitterContext, T element, Rectangle2D bounds)
add one element to the RTree.static <T> RTree<T>
addAll(RTree<T> rtree, SplitterContext<T> splitterContext, Collection<Map.Entry<T,Rectangle2D>> entries)
static <T> RTree<T>
bulkAdd(RTree<T> rtree, SplitterContext<T> splitterContext, Collection<Map.Entry<T,Rectangle2D>> items)
int
count()
count all the elements in the R-Treestatic <T> RTree<T>
create()
create and return an empty R-TreeCollection<TreeNode>
getContainingLeafs(Point2D p)
get the R-Tree leaf nodes that would contain the passed pointSet<Shape>
getGrid()
T
getPickedObject(Point2D p)
return an object at point pOptional<Node<T>>
getRoot()
static <T> RTree
reinsert(RTree<T> rtree, SplitterContext<T> splitterContext)
static <T> RTree<T>
remove(RTree<T> rtree, T element)
remove an element from the treestatic <T> RTree
removeForReinsert(RTree<T> rtree, Collection<Map.Entry<T,Rectangle2D>> removed)
String
toString()
-
-
-
Method Detail
-
create
public static <T> RTree<T> create()
create and return an empty R-Tree- Type Parameters:
T
-- Returns:
- an empty R-Tree
-
addAll
public static <T> RTree<T> addAll(RTree<T> rtree, SplitterContext<T> splitterContext, Collection<Map.Entry<T,Rectangle2D>> entries)
-
add
public static <T> RTree<T> add(RTree<T> rtree, SplitterContext<T> splitterContext, Map.Entry<T,Rectangle2D> entry)
-
add
public static <T> RTree<T> add(RTree<T> rtree, SplitterContext<T> splitterContext, T element, Rectangle2D bounds)
add one element to the RTree. Adding to the tree can result in a new- Parameters:
splitterContext
- the R*Tree or R-Tree ruleselement
- to add to the treebounds
- for the element to add- Returns:
- a new RTree containing the added element
-
bulkAdd
public static <T> RTree<T> bulkAdd(RTree<T> rtree, SplitterContext<T> splitterContext, Collection<Map.Entry<T,Rectangle2D>> items)
-
removeForReinsert
public static <T> RTree removeForReinsert(RTree<T> rtree, Collection<Map.Entry<T,Rectangle2D>> removed)
-
reinsert
public static <T> RTree reinsert(RTree<T> rtree, SplitterContext<T> splitterContext)
-
remove
public static <T> RTree<T> remove(RTree<T> rtree, T element)
remove an element from the tree- Parameters:
element
-- Returns:
-
getPickedObject
public T getPickedObject(Point2D p)
return an object at point p- Parameters:
p
- point to search- Returns:
- an element that contains p or null
-
getContainingLeafs
public Collection<TreeNode> getContainingLeafs(Point2D p)
get the R-Tree leaf nodes that would contain the passed point- Parameters:
p
- the point to search- Returns:
- a Collection of R-Tree nodes that would contain p
-
count
public int count()
count all the elements in the R-Tree- Returns:
- the count
-
-