Package arez.dom

Class Position

java.lang.Object
arez.dom.Position

public final class Position extends Object
An immutable variant of GeolocationCoordinates.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Position(double accuracy, Double altitude, Double heading, double latitude, double longitude, Double speed)
    Create the position object.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    double
    Return the accuracy of the latitude and longitude properties, expressed in meters.
    Return the position's altitude in meters, relative to sea level.
    Return the direction in which the device is traveling.
    double
    Return the position's latitude in decimal degrees.
    double
    Return the position's longitude in decimal degrees.
    Return the velocity of the device in meters per second.
    int
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Position

      public Position(double accuracy, @Nullable Double altitude, @Nullable Double heading, double latitude, double longitude, @Nullable Double speed)
      Create the position object.
      Parameters:
      accuracy - the accuracy.
      altitude - the altitude.
      heading - the heading.
      latitude - the latitude.
      longitude - the longitude.
      speed - the speed.
  • Method Details

    • getAccuracy

      public double getAccuracy()
      Return the accuracy of the latitude and longitude properties, expressed in meters.
      Returns:
      the accuracy.
    • getAltitude

      @Nullable public Double getAltitude()
      Return the position's altitude in meters, relative to sea level. This value can be null if the implementation cannot provide the data.
      Returns:
      the altitude.
    • getHeading

      @Nullable public Double getHeading()
      Return the direction in which the device is traveling. This value, specified in degrees, indicates how far off from heading true north the device is. 0 degrees represents true north, and the direction is determined clockwise (which means that east is 90 degrees and west is 270 degrees). If speed is 0, heading is NaN. If the device is unable to provide heading information, this value is null.
      Returns:
      the heading.
    • getLatitude

      public double getLatitude()
      Return the position's latitude in decimal degrees.
      Returns:
      the latitude.
    • getLongitude

      public double getLongitude()
      Return the position's longitude in decimal degrees.
      Returns:
      the longitude.
    • getSpeed

      @Nullable public Double getSpeed()
      Return the velocity of the device in meters per second.
      Returns:
      the speed.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object