XYPoint (Lucene 10.5.1 core API)
Description: declaration: package: org.apache.lucene.geo, class: XYPoint

Package org.apache.lucene.geo

# Class XYPoint

java.lang.Object
org.apache.lucene.geo.Geometry
org.apache.lucene.geo.XYGeometry
org.apache.lucene.geo.XYPoint

public final class XYPoint extends XYGeometry
Represents a point on the earth's surface. You can construct the point directly with `double` coordinates.

NOTES:

1. latitude/longitude values must be in decimal degrees.
2. For more advanced GeoSpatial indexing and query operations see the `spatial-extras` module

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `XYPoint(float x, float y)`
  Creates a new Point from the supplied latitude/longitude.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object o)`
  `float`
  `getX()`
  Returns latitude value at given index
  `float`
  `getY()`
  Returns longitude value at given index
  `int`
  `hashCode()`
  `protected Component2D`
  `toComponent2D()`
  get a Component2D from the geometry object
  `String`
  `toString()`

  ### Methods inherited from class org.apache.lucene.geo.XYGeometry

  `create`

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

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

- ## Constructor Details

  - ### XYPoint

    public XYPoint(float x, float y)
    Creates a new Point from the supplied latitude/longitude.

- ## Method Details

  - ### getX

    public float getX()
    Returns latitude value at given index

  - ### getY

    public float getY()
    Returns longitude value at given index

  - ### toComponent2D

    protected Component2D toComponent2D()
    Description copied from class: `Geometry`
    get a Component2D from the geometry object
    Specified by:
      `toComponent2D` in class `Geometry`

  - ### 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`