Class Line

All Implemented Interfaces:
AutoCloseable

public final class Line extends Curve implements AutoCloseable
Represents a line.
See Also:
  • Constructor Details

    • Line

      public Line(@NotNull Line other)
    • Line

      public Line(@NotNull Coordinate startPoint, @NotNull Coordinate endPoint, @NotNull LineInterpolationType interpolationType, @NotNull CoordinateReference reference) throws IllegalArgumentException
      Creates a line segment.

      Line objects can be created with the interpolation types:

      • linear
      • geodesic
      • rhumb

      The interpolation types geodesic and rhumb are only allowed for geodetic coordinate references.

      Parameters:
      startPoint - the start point of the line
      endPoint - the end point of the line
      interpolationType - the interpolation type
      reference - the reference of the line
      Throws:
      IllegalArgumentException - if the line cannot be constructed. For example for an invalid combination of coordinate reference and interpolation type.
      Since:
      2025.0
  • Method Details

    • finalize

      protected void finalize()
      Overrides:
      finalize in class Curve
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Overrides:
      close in class Curve
    • getStartPoint

      @NotNull public Coordinate getStartPoint()
      Returns the start point of the line segment.
      Returns:
      the start point of the line segment.
    • getEndPoint

      @NotNull public Coordinate getEndPoint()
      Returns the end point of the line segment.
      Returns:
      the end point of the line segment.
    • getInterpolationType

      @NotNull public LineInterpolationType getInterpolationType()
      Returns the interpolation type of the line segment.

      One of

      • LineInterpolationType::geodesic
      • LineInterpolationType::rhumb
      • LineInterpolationType::linear
      Returns:
      the interpolation type of the line segment.