Class PointType

  • All Implemented Interfaces:
    Command, ComplexType, State, Type

    public class PointType
    extends Object
    implements ComplexType, Command, State
    This type can be used for items that are dealing with GPS or location awareness functionality.
    Gaël L'hopital - Initial contribution, John Cocula - Initial contribution
    • Constructor Detail

      • PointType

        public PointType()
        Default constructor creates a point at sea level where the equator (0° latitude) and the prime meridian (0° longitude) intersect. A nullary constructor is needed by ItemUpdater.receiveUpdate(
      • PointType

        public PointType​(String value)
    • Method Detail

      • setAltitude

        public void setAltitude​(DecimalType altitude)
      • distanceFrom

        public DecimalType distanceFrom​(PointType otherPoint)
        Return the distance in meters from otherPoint, ignoring altitude. This algorithm also ignores the oblate spheroid shape of Earth and assumes a perfect sphere, so results are inexact.
        otherPoint -
        distance in meters
        See Also:
        Haversine formula
      • format

        public String format​(@Nullable String pattern)
        Formats the value of this type according to a pattern (see Formatter). One single value of this type can be referenced by the pattern using an index. The item order is defined by the natural (alphabetical) order of their keys.
        Specified by:
        format in interface Type
        pattern - the pattern to use containing indexes to reference the single elements of this type
        the formatted string
      • toFullString

        public String toFullString()
        Description copied from interface: Type
        Get a string representation that contains the whole internal representation of the type.

        The returned string could be consumed by the static 'valueOf(String)' method of the respective type to build a new type that is equal to this type.

        Specified by:
        toFullString in interface Type
        a full string representation of the type to be consumed by 'valueOf(String)'
      • hashCode

        public int hashCode()
        hashCode in class Object
      • equals

        public boolean equals​(@Nullable Object obj)
        equals in class Object