public class DMS extends Object implements Serializable
Constructor and Description |
---|
DMS()
Default constructor: initialize to null values
|
DMS(DMS hms)
Copy constructor
|
DMS(double val)
Initialize from a decimal value and calculate H:M:S.sss.
|
DMS(double degrees,
int min,
double sec)
Initialize with the given degrees, minutes and seconds.
|
DMS(String s)
Initialize from a string value, in format H:M:S.sss, hh, d.ddd, or
H M S.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj)
Define equality based on the value
|
int |
getDegrees()
Return the number of degrees (not including minutes or seconds)
|
int |
getMin()
Return the number of minutes (not including degrees or seconds)
|
double |
getSec()
Return the number of seconds (not including degrees and minutes)
|
byte |
getSign()
Return the sign of the value
|
double |
getVal()
Return the value (fractional number of degrees) as a double
|
boolean |
isInitialized()
Return true if this object has been initialized with a valid value
|
static void |
main(String[] args)
Test cases
|
void |
set(double degrees,
int min,
double sec)
Set the degrees, minutes and seconds.
|
void |
setVal(double val)
Set from a decimal value and calculate H:M:S.sss.
|
String |
toString()
Return the value as a String in the form hh:mm:ss.sss.
|
public DMS()
public DMS(double degrees, int min, double sec)
public DMS(double val)
public DMS(DMS hms)
public DMS(String s)
public void set(double degrees, int min, double sec)
public void setVal(double val)
public String toString()
public boolean isInitialized()
public int getDegrees()
public int getMin()
public double getSec()
public double getVal()
public byte getSign()
public boolean equals(Object obj)
public static void main(String[] args)
Copyright © 2023 Central Laboratory of the Research Councils. All Rights Reserved.