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

Package org.apache.lucene.geo

# Class XYLine

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

public class XYLine extends XYGeometry
Represents a line in cartesian space. You can construct the Line directly with `float[]`, `float[]` x, y arrays coordinates.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `final float`
  `maxX`
  maximum y of this line's bounding box
  `final float`
  `maxY`
  maximum y of this line's bounding box
  `final float`
  `minX`
  minimum x of this line's bounding box
  `final float`
  `minY`
  minimum y of this line's bounding box

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `XYLine(float[] x, float[] y)`
  Creates a new Line from the supplied X/Y array.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `equals(Object o)`
  `float[]`
  `getX()`
  Returns a copy of the internal x array
  `float`
  `getX(int vertex)`
  Returns x value at given index
  `float[]`
  `getY()`
  Returns a copy of the internal y array
  `float`
  `getY(int vertex)`
  Returns y value at given index
  `int`
  `hashCode()`
  `int`
  `numPoints()`
  returns the number of vertex points
  `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`

- ## Field Details

  - ### minX

    public final float minX
    minimum x of this line's bounding box

  - ### maxX

    public final float maxX
    maximum y of this line's bounding box

  - ### minY

    public final float minY
    minimum y of this line's bounding box

  - ### maxY

    public final float maxY
    maximum y of this line's bounding box

- ## Constructor Details

  - ### XYLine

    public XYLine(float[] x, float[] y)
    Creates a new Line from the supplied X/Y array.

- ## Method Details

  - ### numPoints

    public int numPoints()
    returns the number of vertex points

  - ### getX

    public float getX(int vertex)
    Returns x value at given index

  - ### getY

    public float getY(int vertex)
    Returns y value at given index

  - ### getX

    public float[] getX()
    Returns a copy of the internal x array

  - ### getY

    public float[] getY()
    Returns a copy of the internal y array

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