java.lang.Object
org.elasticsearch.lucene.spatial.Extent

public class Extent extends Object
Object representing the extent of a geometry object within a TriangleTreeWriter.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int
     
    int
     
    int
     
    int
     
    int
     
    int
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addRectangle(int bottomLeftX, int bottomLeftY, int topRightX, int topRightY)
    Adds the extent of two points representing a bounding box's bottom-left and top-right points.
    boolean
     
    static Extent
    fromPoint(int x, int y)
    calculates the extent of a point, which is the point itself.
    static Extent
    fromPoints(int bottomLeftX, int bottomLeftY, int topRightX, int topRightY)
    calculates the extent of two points representing a bounding box's bottom-left and top-right points.
    int
     
    int
     
    int
     
    int
     
    int
     
    void
    reset(int top, int bottom, int negLeft, int negRight, int posLeft, int posRight)
     
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • top

      public int top
    • bottom

      public int bottom
    • negLeft

      public int negLeft
    • negRight

      public int negRight
    • posLeft

      public int posLeft
    • posRight

      public int posRight
  • Method Details

    • reset

      public void reset(int top, int bottom, int negLeft, int negRight, int posLeft, int posRight)
    • addRectangle

      public void addRectangle(int bottomLeftX, int bottomLeftY, int topRightX, int topRightY)
      Adds the extent of two points representing a bounding box's bottom-left and top-right points. The bounding box must not cross the dateline.
      Parameters:
      bottomLeftX - the bottom-left x-coordinate
      bottomLeftY - the bottom-left y-coordinate
      topRightX - the top-right x-coordinate
      topRightY - the top-right y-coordinate
    • fromPoint

      public static Extent fromPoint(int x, int y)
      calculates the extent of a point, which is the point itself.
      Parameters:
      x - the x-coordinate of the point
      y - the y-coordinate of the point
      Returns:
      the extent of the point
    • fromPoints

      public static Extent fromPoints(int bottomLeftX, int bottomLeftY, int topRightX, int topRightY)
      calculates the extent of two points representing a bounding box's bottom-left and top-right points. It is important that these points accurately represent the bottom-left and top-right of the extent since there is no validation being done.
      Parameters:
      bottomLeftX - the bottom-left x-coordinate
      bottomLeftY - the bottom-left y-coordinate
      topRightX - the top-right x-coordinate
      topRightY - the top-right y-coordinate
      Returns:
      the extent of the two points
    • minY

      public int minY()
      Returns:
      the minimum y-coordinate of the extent
    • maxY

      public int maxY()
      Returns:
      the maximum y-coordinate of the extent
    • minX

      public int minX()
      Returns:
      the absolute minimum x-coordinate of the extent, whether it is positive or negative.
    • maxX

      public int maxX()
      Returns:
      the absolute maximum x-coordinate of the extent, whether it is positive or negative.
    • 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