Package edu.sc.seis.seisFile
Class Location
- java.lang.Object
-
- edu.sc.seis.seisFile.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 Summary
Fields Modifier and Type Field Description static java.lang.StringlatLonFormatstatic java.util.Localelocale
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description LocationasLocation()static java.lang.StringcreateLocationDescription(Location loc)booleanequals(java.lang.Object o)static java.lang.StringformatLatLon(double latlon)java.lang.DoublegetDepthKm()java.lang.DoublegetDepthMeter()java.lang.StringgetDescription()doublegetLatitude()java.lang.StringgetLocationDescription()doublegetLongitude()booleanhasDepth()booleanhasDescription()inthashCode()voidsetDescription(java.lang.String desc)java.lang.StringtoString()
-
-
-
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:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
formatLatLon
public static java.lang.String formatLatLon(double latlon)
-
asLocation
public Location asLocation()
- Specified by:
asLocationin interfaceLatLonLocatable
-
getLocationDescription
public java.lang.String getLocationDescription()
- Specified by:
getLocationDescriptionin interfaceLatLonLocatable
-
createLocationDescription
public static java.lang.String createLocationDescription(Location loc)
-
-