Package org.apache.lucene.geo
Class Rectangle2D
- java.lang.Object
-
- org.apache.lucene.geo.Rectangle2D
-
- All Implemented Interfaces:
Component2D
final class Rectangle2D extends java.lang.Object implements Component2D
2D rectangle implementation containing cartesian spatial logic.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.lucene.geo.Component2D
Component2D.WithinRelation
-
-
Field Summary
Fields Modifier and Type Field Description private static doubleMAX_LON_INCL_QUANTIZEprivate doublemaxXprivate doublemaxYprivate static doubleMIN_LON_INCL_QUANTIZEprivate doubleminXprivate doubleminY
-
Constructor Summary
Constructors Modifier Constructor Description privateRectangle2D(double minX, double maxX, double minY, double maxY)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(double x, double y)relates this component2D with a pointbooleancontainsLine(double minX, double maxX, double minY, double maxY, double aX, double aY, double bX, double bY)return true if this component2D contains the provided linebooleancontainsTriangle(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(Rectangle rectangle)create a component2D from the provided LatLon rectangle(package private) static Component2Dcreate(XYRectangle rectangle)create a component2D from the provided XY rectangleprivate booleanedgesIntersect(double aX, double aY, double bX, double bY)booleanequals(java.lang.Object o)doublegetMaxX()max X value for the componentdoublegetMaxY()max Y value for the componentdoublegetMinX()min X value for the componentdoublegetMinY()min Y value for the componentinthashCode()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 linebooleanintersectsTriangle(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 trianglePointValues.Relationrelate(double minX, double maxX, double minY, double maxY)relates this component2D with a bounding boxjava.lang.StringtoString()Component2D.WithinRelationwithinLine(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 lineComponent2D.WithinRelationwithinPoint(double x, double y)Compute the within relation of this component2D with a pointComponent2D.WithinRelationwithinTriangle(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, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.lucene.geo.Component2D
containsLine, containsTriangle, intersectsLine, intersectsTriangle, withinLine, withinTriangle
-
-
-
-
Method Detail
-
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
-
relate
public PointValues.Relation relate(double minX, double maxX, double minY, double maxY)
Description copied from interface:Component2Drelates this component2D with a bounding box- Specified by:
relatein 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
public Component2D.WithinRelation withinPoint(double x, double y)
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
-
edgesIntersect
private boolean edgesIntersect(double aX, double aY, double bX, double bY)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
create
static Component2D create(XYRectangle rectangle)
create a component2D from the provided XY rectangle
-
create
static Component2D create(Rectangle rectangle)
create a component2D from the provided LatLon rectangle
-
-