Class Rectangle2D

java.lang.Object
org.apache.lucene.geo.Rectangle2D
All Implemented Interfaces:
Component2D

final class Rectangle2D extends 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 double
     
    private final double
     
    private final double
     
    private static double
     
    private final double
     
    private final double
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Rectangle2D(double minX, double maxX, double minY, double maxY)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    contains(double x, double y)
    relates this component2D with a point *
    boolean
    containsLine(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 *
    boolean
    containsTriangle(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 Component2D
    create(Rectangle rectangle)
    create a component2D from the provided LatLon rectangle
    (package private) static Component2D
    create(XYRectangle rectangle)
    create a component2D from the provided XY rectangle
    private boolean
    edgesIntersect(double aX, double aY, double bX, double bY)
     
    boolean
     
    double
    max X value for the component *
    double
    max Y value for the component *
    double
    min X value for the component *
    double
    min Y value for the component *
    int
     
    boolean
    intersectsLine(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 *
    boolean
    intersectsTriangle(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, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.apache.lucene.geo.Component2D

    containsLine, containsTriangle, intersectsLine, intersectsTriangle, withinLine, withinTriangle
  • Field Details

    • minX

      private final double minX
    • maxX

      private final double maxX
    • minY

      private final double minY
    • maxY

      private final double maxY
    • MIN_LON_INCL_QUANTIZE

      private static double MIN_LON_INCL_QUANTIZE
    • MAX_LON_INCL_QUANTIZE

      private static double MAX_LON_INCL_QUANTIZE
  • Constructor Details

    • Rectangle2D

      private Rectangle2D(double minX, double maxX, double minY, double maxY)
  • Method Details

    • getMinX

      public double getMinX()
      Description copied from interface: Component2D
      min X value for the component *
      Specified by:
      getMinX in interface Component2D
    • getMaxX

      public double getMaxX()
      Description copied from interface: Component2D
      max X value for the component *
      Specified by:
      getMaxX in interface Component2D
    • getMinY

      public double getMinY()
      Description copied from interface: Component2D
      min Y value for the component *
      Specified by:
      getMinY in interface Component2D
    • getMaxY

      public double getMaxY()
      Description copied from interface: Component2D
      max Y value for the component *
      Specified by:
      getMaxY in interface Component2D
    • contains

      public boolean contains(double x, double y)
      Description copied from interface: Component2D
      relates this component2D with a point *
      Specified by:
      contains in interface Component2D
    • relate

      public PointValues.Relation relate(double minX, double maxX, double minY, double maxY)
      Description copied from interface: Component2D
      relates this component2D with a bounding box *
      Specified by:
      relate in interface Component2D
    • intersectsLine

      public boolean intersectsLine(double minX, double maxX, double minY, double maxY, double aX, double aY, double bX, double bY)
      Description copied from interface: Component2D
      return true if this component2D intersects the provided line *
      Specified by:
      intersectsLine in interface Component2D
    • 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: Component2D
      return true if this component2D intersects the provided triangle *
      Specified by:
      intersectsTriangle in interface Component2D
    • containsLine

      public boolean containsLine(double minX, double maxX, double minY, double maxY, double aX, double aY, double bX, double bY)
      Description copied from interface: Component2D
      return true if this component2D contains the provided line *
      Specified by:
      containsLine in interface Component2D
    • 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: Component2D
      return true if this component2D contains the provided triangle *
      Specified by:
      containsTriangle in interface Component2D
    • withinPoint

      public Component2D.WithinRelation withinPoint(double x, double y)
      Description copied from interface: Component2D
      Compute the within relation of this component2D with a point *
      Specified by:
      withinPoint in interface Component2D
    • 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: Component2D
      Compute the within relation of this component2D with a line *
      Specified by:
      withinLine in interface Component2D
    • 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: Component2D
      Compute the within relation of this component2D with a triangle *
      Specified by:
      withinTriangle in interface Component2D
    • edgesIntersect

      private boolean edgesIntersect(double aX, double aY, double bX, double bY)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class 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