Module org.apache.lucene.spatial3d
Package org.apache.lucene.spatial3d.geom
Class GeoComplexPolygon.Tree
- java.lang.Object
-
- org.apache.lucene.spatial3d.geom.GeoComplexPolygon.Tree
-
- Direct Known Subclasses:
GeoComplexPolygon.XTree
,GeoComplexPolygon.YTree
,GeoComplexPolygon.ZTree
- Enclosing class:
- GeoComplexPolygon
private abstract static class GeoComplexPolygon.Tree extends java.lang.Object
An interface describing a tree.
-
-
Field Summary
Fields Modifier and Type Field Description private GeoComplexPolygon.Node
rootNode
-
Constructor Summary
Constructors Constructor Description Tree(java.util.List<GeoComplexPolygon.Edge> allEdges)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private static GeoComplexPolygon.Node
createTree(GeoComplexPolygon.Node[] edges, int low, int high)
protected abstract double
getMaximum(GeoComplexPolygon.Edge edge)
Get the maximum value from the edge.protected abstract double
getMinimum(GeoComplexPolygon.Edge edge)
Get the minimum value from the edge.boolean
traverse(GeoComplexPolygon.EdgeIterator edgeIterator, double value)
Traverse the tree, finding all edges that intersect the provided value.boolean
traverse(GeoComplexPolygon.EdgeIterator edgeIterator, double minValue, double maxValue)
Traverse the tree, finding all edges that intersect the provided value range.
-
-
-
Field Detail
-
rootNode
private final GeoComplexPolygon.Node rootNode
-
-
Constructor Detail
-
Tree
public Tree(java.util.List<GeoComplexPolygon.Edge> allEdges)
Constructor.- Parameters:
allEdges
- is the list of all edges for the tree.
-
-
Method Detail
-
createTree
private static GeoComplexPolygon.Node createTree(GeoComplexPolygon.Node[] edges, int low, int high)
-
getMinimum
protected abstract double getMinimum(GeoComplexPolygon.Edge edge)
Get the minimum value from the edge.- Parameters:
edge
- is the edge.- Returns:
- the minimum value.
-
getMaximum
protected abstract double getMaximum(GeoComplexPolygon.Edge edge)
Get the maximum value from the edge.- Parameters:
edge
- is the edge.- Returns:
- the maximum value.
-
traverse
public boolean traverse(GeoComplexPolygon.EdgeIterator edgeIterator, double value)
Traverse the tree, finding all edges that intersect the provided value.- Parameters:
edgeIterator
- provides the method to call for any encountered matching edge.value
- is the value to match.- Returns:
- false if the traversal was aborted before completion.
-
traverse
public boolean traverse(GeoComplexPolygon.EdgeIterator edgeIterator, double minValue, double maxValue)
Traverse the tree, finding all edges that intersect the provided value range.- Parameters:
edgeIterator
- provides the method to call for any encountered matching edge. Edges will not be invoked more than once.minValue
- is the minimum value.maxValue
- is the maximum value.- Returns:
- false if the traversal was aborted before completion.
-
-