Interface LocationParameter<T>

Type Parameters:
T - Type of the final builder
All Known Subinterfaces:
MoonPosition.Parameters, MoonTimes.Parameters, SunPosition.Parameters, SunTimes.Parameters
All Known Implementing Classes:
BaseBuilder

public interface LocationParameter<T>
Location based parameters.

Use them to give information about the geolocation of the observer. If ommitted, the coordinates of Null Island are used.

  • Method Summary

    Modifier and Type
    Method
    Description
    default T
    at(double[] coords)
    Sets the geolocation.
    default T
    at(double lat, double lng)
    Sets the geolocation.
    height(double h)
    Sets the height.
    latitude(double lat)
    Sets the latitude.
    default T
    latitude(int d, int m, double s)
    Sets the latitude.
    longitude(double lng)
    Sets the longitude.
    default T
    longitude(int d, int m, double s)
    Sets the longitude.
    Uses the same location as given in the LocationParameter at this moment.
  • Method Details

    • latitude

      T latitude(double lat)
      Sets the latitude.
      Parameters:
      lat - Latitude, in degrees.
      Returns:
      itself
    • longitude

      T longitude(double lng)
      Sets the longitude.
      Parameters:
      lng - Longitude, in degrees.
      Returns:
      itself
    • height

      T height(double h)
      Sets the height.
      Parameters:
      h - Height, in meters above sea level. Default: 0.0 m. Negative values are silently changed to the acceptable minimum of 0.0 m.
      Returns:
      itself
    • at

      default T at(double lat, double lng)
      Sets the geolocation.
      Parameters:
      lat - Latitude, in degrees.
      lng - Longitude, in degrees.
      Returns:
      itself
    • at

      default T at(double[] coords)
      Sets the geolocation. In the given array, index 0 must contain the latitude, and index 1 must contain the longitude. An optional index 2 may contain the height, in meters.

      This call is meant to be used for coordinates stored in constants.

      Parameters:
      coords - Array containing the latitude and longitude, in degrees.
      Returns:
      itself
    • latitude

      default T latitude(int d, int m, double s)
      Sets the latitude.
      Parameters:
      d - Degrees
      m - Minutes
      s - Seconds (and fraction of seconds)
      Returns:
      itself
    • longitude

      default T longitude(int d, int m, double s)
      Sets the longitude.
      Parameters:
      d - Degrees
      m - Minutes
      s - Seconds (and fraction of seconds)
      Returns:
      itself
    • sameLocationAs

      Uses the same location as given in the LocationParameter at this moment.

      Changes to the source parameter will not affect this parameter, though.

      Parameters:
      l - LocationParameter to be used.
      Returns:
      itself