Class Location

  • All Implemented Interfaces:
    LatLonLocatable

    public class Location
    extends java.lang.Object
    implements LatLonLocatable
    Simple class to hold a lat/lon pair, with optional depth, defaults to 0.
    • Field Detail

      • locale

        public static java.util.Locale locale
      • latLonFormat

        public static java.lang.String latLonFormat
    • Constructor Detail

      • Location

        public Location​(double latitude,
                        double longitude)
      • Location

        public Location​(double latitude,
                        double longitude,
                        double depth_meter)
      • Location

        public Location​(Station sta)
      • Location

        public Location​(Channel chan)
      • Location

        public Location​(Event ev)
      • Location

        public Location​(Origin o)
    • Method Detail

      • getLatitude

        public double getLatitude()
      • getLongitude

        public double getLongitude()
      • hasDepth

        public boolean hasDepth()
        Returns:
        true if this Location has a depth set.
      • getDepthMeter

        public java.lang.Double getDepthMeter()
        Returns:
        depth in meters if set, otherwise null
      • getDepthKm

        public java.lang.Double getDepthKm()
        Returns:
        depth in kilometers if set, otherwise null
      • hasDescription

        public boolean hasDescription()
        Returns:
        true if this Location has an optional description.
      • getDescription

        public java.lang.String getDescription()
        Returns:
        an optional description, like event time or station code.
      • setDescription

        public void setDescription​(java.lang.String desc)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • formatLatLon

        public static java.lang.String formatLatLon​(double latlon)
      • createLocationDescription

        public static java.lang.String createLocationDescription​(Location loc)