Package adams.data.gps
Class GPSDecimalMinutes
- java.lang.Object
-
- adams.data.gps.AbstractGPS
-
- adams.data.gps.GPSDecimalMinutes
-
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<AbstractGPS>
public class GPSDecimalMinutes extends AbstractGPS
GPS coordinates with degrees in integer and minutes (incl seconds) in decimal notation.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static String
FORMAT
the regular expression.static String
FORMAT_SWAPPED
the regular expression (swapped).-
Fields inherited from class adams.data.gps.AbstractGPS
m_Latitude, m_Longitude, NUM_DECIMALS
-
-
Constructor Summary
Constructors Constructor Description GPSDecimalMinutes()
Default constructor.GPSDecimalMinutes(double lat, double lon)
Initialize GPS with latitude and longitude (in decimal notation).GPSDecimalMinutes(AbstractGPS gps)
Initialize GPS with latitude and longitude from the specified object.GPSDecimalMinutes(Coordinate lat, Coordinate lon)
Initialize GPS with latitude and longitude.GPSDecimalMinutes(String s)
Initialize GPS with latitude and longitude in string representation.GPSDecimalMinutes(String s, boolean swapped)
Initialize GPS with latitude and longitude in string representation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected GPSDecimalMinutes
clone()
Creates a copy of itself.protected Coordinate[]
parse(String s, boolean swapped)
Parses the string.String
toString()
Turns the GPS object back into its string representation.-
Methods inherited from class adams.data.gps.AbstractGPS
compareTo, equals, fromString, fromString, getLatitude, getLongitude, isValid, isValid, parse, preprocess
-
-
-
-
Field Detail
-
FORMAT
public static final String FORMAT
the regular expression.- See Also:
- Constant Field Values
-
FORMAT_SWAPPED
public static final String FORMAT_SWAPPED
the regular expression (swapped).- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GPSDecimalMinutes
public GPSDecimalMinutes()
Default constructor.
-
GPSDecimalMinutes
public GPSDecimalMinutes(String s)
Initialize GPS with latitude and longitude in string representation.- Parameters:
s
- the string representation to parse
-
GPSDecimalMinutes
public GPSDecimalMinutes(String s, boolean swapped)
Initialize GPS with latitude and longitude in string representation.- Parameters:
s
- the string representation to parseswapped
- whether format is 'long lat' instead of 'lat long'
-
GPSDecimalMinutes
public GPSDecimalMinutes(AbstractGPS gps)
Initialize GPS with latitude and longitude from the specified object.- Parameters:
gps
- the GPS object to use the lat/lon from
-
GPSDecimalMinutes
public GPSDecimalMinutes(double lat, double lon)
Initialize GPS with latitude and longitude (in decimal notation).- Parameters:
lat
- latitudelon
- longitude
-
GPSDecimalMinutes
public GPSDecimalMinutes(Coordinate lat, Coordinate lon)
Initialize GPS with latitude and longitude.- Parameters:
lat
- latitudelon
- longitude
-
-
Method Detail
-
clone
protected GPSDecimalMinutes clone()
Creates a copy of itself.- Specified by:
clone
in classAbstractGPS
- Returns:
- the copy
-
parse
protected Coordinate[] parse(String s, boolean swapped)
Parses the string.- Specified by:
parse
in classAbstractGPS
- Parameters:
s
- the string to parseswapped
- "long lat" instead of "lat long"- Returns:
- the coordinates (lat/long), null if failed to parse
-
toString
public String toString()
Turns the GPS object back into its string representation.- Specified by:
toString
in classAbstractGPS
- Returns:
- the string representation
-
-