org.apache.lucene.geo

## Class Rectangle2D

- java.lang.Object
- - org.apache.lucene.geo.Rectangle2D

- Direct Known Subclasses:
    XYRectangle2D

      public class Rectangle2D
      extends Object

  2D rectangle implementation containing geo spatial logic.
  NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected byte[]` | `bbox`
    `protected int` | `maxX`
    `protected int` | `maxY`
    `protected int` | `minX`
    `protected int` | `minY`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `Rectangle2D(double minLat, double maxLat, double minLon, double maxLon)`
    `protected` | `Rectangle2D(int minX, int maxX, int minY, int maxY)`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `containsTriangle(int ax, int ay, int bx, int by, int cx, int cy)` Checks if the rectangle contains the provided triangle
    `static Rectangle2D` | `create(Rectangle rectangle)` Builds a Rectangle2D from rectangle
    `boolean` | `crossesDateline()`
    `boolean` | `equals(Object o)`
    `int` | `hashCode()`
    `PointValues.Relation` | `intersectRangeBBox(int minXOffset, int minYOffset, byte[] minTriangle, int maxXOffset, int maxYOffset, byte[] maxTriangle)` intersects this to a provided range bounding box
    `boolean` | `intersectsTriangle(int aX, int aY, int bX, int bY, int cX, int cY)` Checks if the rectangle intersects the provided triangle
    `boolean` | `queryContainsPoint(int x, int y)` Checks if the rectangle contains the provided point
    `PointValues.Relation` | `relateRangeBBox(int minXOffset, int minYOffset, byte[] minTriangle, int maxXOffset, int maxYOffset, byte[] maxTriangle)` compare this to a provided range bounding box

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### bbox

          protected final byte[] bbox

    - #### minX

          protected final int minX

    - #### maxX

          protected final int maxX

    - #### minY

          protected final int minY

    - #### maxY

          protected final int maxY

  - ### Constructor Detail

    - #### Rectangle2D

          protected Rectangle2D(double minLat,
                                double maxLat,
                                double minLon,
                                double maxLon)

    - #### Rectangle2D

          protected Rectangle2D(int minX,
                                int maxX,
                                int minY,
                                int maxY)

  - ### Method Detail

    - #### create

          public static Rectangle2D create(Rectangle rectangle)

      Builds a Rectangle2D from rectangle

    - #### crossesDateline

          public boolean crossesDateline()

    - #### queryContainsPoint

          public boolean queryContainsPoint(int x,
                                            int y)

      Checks if the rectangle contains the provided point

    - #### relateRangeBBox

          public PointValues.Relation relateRangeBBox(int minXOffset,
                                                      int minYOffset,
                                                      byte[] minTriangle,
                                                      int maxXOffset,
                                                      int maxYOffset,
                                                      byte[] maxTriangle)

      compare this to a provided range bounding box

    - #### intersectRangeBBox

          public PointValues.Relation intersectRangeBBox(int minXOffset,
                                                         int minYOffset,
                                                         byte[] minTriangle,
                                                         int maxXOffset,
                                                         int maxYOffset,
                                                         byte[] maxTriangle)

      intersects this to a provided range bounding box

    - #### intersectsTriangle

          public boolean intersectsTriangle(int aX,
                                            int aY,
                                            int bX,
                                            int bY,
                                            int cX,
                                            int cY)

      Checks if the rectangle intersects the provided triangle

    - #### containsTriangle

          public boolean containsTriangle(int ax,
                                          int ay,
                                          int bx,
                                          int by,
                                          int cx,
                                          int cy)

      Checks if the rectangle contains the provided triangle

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

Copyright © 2000-2019 Apache Software Foundation. All Rights Reserved.