Enum Class LatLonFormatter.Format

java.lang.Object
java.lang.Enum<LatLonFormatter.Format>
org.ka2ddo.yaac.util.LatLonFormatter.Format
All Implemented Interfaces:
Serializable, Comparable<LatLonFormatter.Format>, Constable
Enclosing class:
LatLonFormatter

public static enum LatLonFormatter.Format extends Enum<LatLonFormatter.Format>
Define the supported different formats for latitude and longitude display.
Author:
Andrew Pavlin, KA2DDO
  • Enum Constant Details

    • DDMM_MM

      public static final LatLonFormatter.Format DDMM_MM
      Format a latitude or longitude in degrees and fractional minutes.
    • DDMMSS

      public static final LatLonFormatter.Format DDMMSS
      Format a latitude or longitude in degrees, minutes, and seconds,
    • DD_DDDDDD

      public static final LatLonFormatter.Format DD_DDDDDD
      Format a latitude or longitude in fractional degrees.
    • UTM

      public static final LatLonFormatter.Format UTM
      Format a latitude/longitude pair in UTM (Universal Transverse Mercator) encoding.
  • Method Details

    • values

      public static LatLonFormatter.Format[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static LatLonFormatter.Format valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • format

      public abstract String format(double value, boolean isLat)
      Convert the specified latitude or longitude value into a String of this format.
      Parameters:
      value - value in fractional degrees North or East
      isLat - whether to interpret this as a latitude or longitude value
      Returns:
      formatted String value
    • toString

      public String toString()
      Return the user-pretty version of this enum's name.
      Overrides:
      toString in class Enum<LatLonFormatter.Format>
      Returns:
      the pretty name of this enum constant