Class WGS84Position

java.lang.Object
de.powerstat.validation.values.WGS84Position
All Implemented Interfaces:
IValueObject, Comparable<WGS84Position>

public final class WGS84Position extends Object implements Comparable<WGS84Position>, IValueObject
World geodetic system 1984 position. Possibly DSGVO relevant. TODO precision TODO output formats TODO Get address for position if possible
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final double
    Positions altitude - height above sea level.
    private static final double
    Epsilon for double compare.
    private final double
    Positions latitude specifies the north–south position of a point on the Earth's surface.
    private final double
    Positions longitude specifies the east–west position of a point on the Earth's surface.
    private static final String
    Position separator.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    WGS84Position(double latitude, double longitude, double altitude)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Compare with another object.
    boolean
    Is equal with another object.
    double
    Get altitude.
    double
    Get latitude.
    double
    Get longitude.
    int
    Calculate hash code.
    of(double latitude, double longitude, double altitude)
    WGS84Position factory.
    of(String value)
    WGS84Position factory.
    Returns the value of this WGS84Position as a String.
    Returns the string representation of this WGS84Position.

    Methods inherited from class java.lang.Object

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

    • EPSILON

      private static final double EPSILON
      Epsilon for double compare.
      See Also:
    • SEPARATOR

      private static final String SEPARATOR
      Position separator.
      See Also:
    • latitude

      private final double latitude
      Positions latitude specifies the north–south position of a point on the Earth's surface. Ranges from 0° at the Equator to 90° (North or South) at the poles.
    • longitude

      private final double longitude
      Positions longitude specifies the east–west position of a point on the Earth's surface. The prime meridian, which passes near the Royal Observatory, Greenwich, England, is defined as 0° longitude by convention. Positive longitudes are east of the prime meridian, and negative ones are west.
    • altitude

      private final double altitude
      Positions altitude - height above sea level.
  • Constructor Details

    • WGS84Position

      private WGS84Position(double latitude, double longitude, double altitude)
      Constructor.
      Parameters:
      latitude - Positions latitude specifies the north–south position of a point on the Earth's surface. Ranges from 0° at the Equator to 90° (North or South) at the poles.
      longitude - Positions longitude specifies the east–west position of a point on the Earth's surface. The prime meridian, which passes near the Royal Observatory, Greenwich, England, is defined as 0° longitude by convention. Positive longitudes are east of the prime meridian, and negative ones are west.
      altitude - Positions altitude - height above sea level.
  • Method Details

    • of

      public static WGS84Position of(double latitude, double longitude, double altitude)
      WGS84Position factory.
      Parameters:
      latitude - Positions latitude specifies the north–south position of a point on the Earth's surface. Ranges from 0° at the Equator to 90° (North or South) at the poles.
      longitude - Positions longitude specifies the east–west position of a point on the Earth's surface. The prime meridian, which passes near the Royal Observatory, Greenwich, England, is defined as 0° longitude by convention. Positive longitudes are east of the prime meridian, and negative ones are west.
      altitude - Positions altitude - height above sea level.
      Returns:
      WGS84Position object
    • of

      public static WGS84Position of(String value)
      WGS84Position factory.
      Parameters:
      value - latitude longitude altitude separated by one space
      Returns:
      WGS84Position object
    • getLatitude

      public double getLatitude()
      Get latitude.
      Returns:
      Latitude
    • getLongitude

      public double getLongitude()
      Get longitude.
      Returns:
      Longitude
    • getAltitude

      public double getAltitude()
      Get altitude.
      Returns:
      Altitude
    • stringValue

      public String stringValue()
      Returns the value of this WGS84Position as a String.
      Specified by:
      stringValue in interface IValueObject
      Returns:
      The value represented by this object after conversion to type String.
    • hashCode

      public int hashCode()
      Calculate hash code.
      Overrides:
      hashCode in class Object
      Returns:
      Hash
      See Also:
    • equals

      public boolean equals(Object obj)
      Is equal with another object.
      Overrides:
      equals in class Object
      Parameters:
      obj - Object
      Returns:
      true when equal, false otherwise
      See Also:
    • toString

      public String toString()
      Returns the string representation of this WGS84Position. The exact details of this representation are unspecified and subject to change, but the following may be regarded as typical: "WGS84Position[latitude=0.0, longitude=0.0, altitude=0.0]"
      Overrides:
      toString in class Object
      Returns:
      String representation of this WGS84Position
      See Also:
    • compareTo

      public int compareTo(WGS84Position obj)
      Compare with another object.
      Specified by:
      compareTo in interface Comparable<WGS84Position>
      Parameters:
      obj - Object to compare with
      Returns:
      0: equal; 1: greater; -1: smaller
      See Also: