java.lang.Object
org.apache.lucene.geo.ComponentTree
- All Implemented Interfaces:
Component2D
2D multi-component geometry implementation represented as an interval tree of components.
Construction takes O(n log n) time for sorting and tree construction.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.lucene.geo.Component2D
Component2D.WithinRelation -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Component2Droot node of edge treeprivate Component2Dprivate doublemaximum X of this geometry's bounding box areaprivate doublemaximum Y of this geometry's bounding box areaprivate doubleminimum X of this geometry's bounding box areaprivate doubleminimum Y of this geometry's bounding box areaprivate Component2Dprivate final booleanwhich dimension was this node split on -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(double x, double y) relates this component2D with a point *booleancontainsLine(double minX, double maxX, double minY, double maxY, double aX, double aY, double bX, double bY) return true if this component2D contains the provided line *booleancontainsTriangle(double minX, double maxX, double minY, double maxY, double aX, double aY, double bX, double bY, double cX, double cY) return true if this component2D contains the provided triangle *(package private) static Component2Dcreate(Component2D[] components) Creates tree from provided componentsprivate static ComponentTreecreateTree(Component2D[] components, int low, int high, boolean splitX) Creates tree from sorted components (with range low and high inclusive)doublegetMaxX()max X value for the component *doublegetMaxY()max Y value for the component *doublegetMinX()min X value for the component *doublegetMinY()min Y value for the component *booleanintersectsLine(double minX, double maxX, double minY, double maxY, double aX, double aY, double bX, double bY) return true if this component2D intersects the provided line *booleanintersectsTriangle(double minX, double maxX, double minY, double maxY, double aX, double aY, double bX, double bY, double cX, double cY) return true if this component2D intersects the provided triangle *relate(double minX, double maxX, double minY, double maxY) relates this component2D with a bounding box *withinLine(double minX, double maxX, double minY, double maxY, double aX, double aY, boolean ab, double bX, double bY) Compute the within relation of this component2D with a line *withinPoint(double x, double y) Compute the within relation of this component2D with a point *withinTriangle(double minX, double maxX, double minY, double maxY, double aX, double aY, boolean ab, double bX, double bY, boolean bc, double cX, double cY, boolean ca) Compute the within relation of this component2D with a triangle *Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.lucene.geo.Component2D
containsLine, containsTriangle, intersectsLine, intersectsTriangle, withinLine, withinTriangle
-
Field Details
-
minY
private double minYminimum Y of this geometry's bounding box area -
maxY
private double maxYmaximum Y of this geometry's bounding box area -
minX
private double minXminimum X of this geometry's bounding box area -
maxX
private double maxXmaximum X of this geometry's bounding box area -
left
-
right
-
splitX
private final boolean splitXwhich dimension was this node split on -
component
root node of edge tree
-
-
Constructor Details
-
ComponentTree
-
-
Method Details
-
getMinX
public double getMinX()Description copied from interface:Component2Dmin X value for the component *- Specified by:
getMinXin interfaceComponent2D
-
getMaxX
public double getMaxX()Description copied from interface:Component2Dmax X value for the component *- Specified by:
getMaxXin interfaceComponent2D
-
getMinY
public double getMinY()Description copied from interface:Component2Dmin Y value for the component *- Specified by:
getMinYin interfaceComponent2D
-
getMaxY
public double getMaxY()Description copied from interface:Component2Dmax Y value for the component *- Specified by:
getMaxYin interfaceComponent2D
-
contains
public boolean contains(double x, double y) Description copied from interface:Component2Drelates this component2D with a point *- Specified by:
containsin interfaceComponent2D
-
intersectsLine
public boolean intersectsLine(double minX, double maxX, double minY, double maxY, double aX, double aY, double bX, double bY) Description copied from interface:Component2Dreturn true if this component2D intersects the provided line *- Specified by:
intersectsLinein interfaceComponent2D
-
intersectsTriangle
public boolean intersectsTriangle(double minX, double maxX, double minY, double maxY, double aX, double aY, double bX, double bY, double cX, double cY) Description copied from interface:Component2Dreturn true if this component2D intersects the provided triangle *- Specified by:
intersectsTrianglein interfaceComponent2D
-
containsLine
public boolean containsLine(double minX, double maxX, double minY, double maxY, double aX, double aY, double bX, double bY) Description copied from interface:Component2Dreturn true if this component2D contains the provided line *- Specified by:
containsLinein interfaceComponent2D
-
containsTriangle
public boolean containsTriangle(double minX, double maxX, double minY, double maxY, double aX, double aY, double bX, double bY, double cX, double cY) Description copied from interface:Component2Dreturn true if this component2D contains the provided triangle *- Specified by:
containsTrianglein interfaceComponent2D
-
withinPoint
Description copied from interface:Component2DCompute the within relation of this component2D with a point *- Specified by:
withinPointin interfaceComponent2D
-
withinLine
public Component2D.WithinRelation withinLine(double minX, double maxX, double minY, double maxY, double aX, double aY, boolean ab, double bX, double bY) Description copied from interface:Component2DCompute the within relation of this component2D with a line *- Specified by:
withinLinein interfaceComponent2D
-
withinTriangle
public Component2D.WithinRelation withinTriangle(double minX, double maxX, double minY, double maxY, double aX, double aY, boolean ab, double bX, double bY, boolean bc, double cX, double cY, boolean ca) Description copied from interface:Component2DCompute the within relation of this component2D with a triangle *- Specified by:
withinTrianglein interfaceComponent2D
-
relate
Description copied from interface:Component2Drelates this component2D with a bounding box *- Specified by:
relatein interfaceComponent2D
-
create
Creates tree from provided components -
createTree
private static ComponentTree createTree(Component2D[] components, int low, int high, boolean splitX) Creates tree from sorted components (with range low and high inclusive)
-