Package uk.ac.starlink.pal
Class palTime
java.lang.Object
uk.ac.starlink.pal.palTime
Angle defined by Hour, minute, second and fraction of a second
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
Get the fraction of a secondint
getFraction
(int n) Get the fraction of a second to a set precisionint
getHour()
Get the hourint
getMin()
Get the minuteint
getSec()
Get the secondchar
getSign()
Get the signGet the sign as a StringtoString()
Get the Angle as a StringtoString
(int n) Get the Angle as a String to a set precision
-
Constructor Details
-
palTime
public palTime(int h, int m, int s, double frac, char c) Angle defined by Hour, minute, second, fraction and sign- Parameters:
h
- Hourm
- Minutes
- Secondfrac
- Fraction of secondc
- Sign ('+' or '-')
-
palTime
public palTime(int h, int m, int s, double frac) Angle defined by Hour, minute, second, fraction- Parameters:
h
- Hourm
- Minutes
- Secondfrac
- Fraction of second
-
palTime
public palTime(int h, int m, int s) Angles defined by Hour, minute, second- Parameters:
h
- Hourm
- Minutes
- Second
-
-
Method Details
-
getHour
public int getHour()Get the hour- Returns:
- Hour
-
getMin
public int getMin()Get the minute- Returns:
- Minute
-
getSec
public int getSec()Get the second- Returns:
- Second
-
getFraction
public double getFraction()Get the fraction of a second- Returns:
- Fraction
-
getFraction
public int getFraction(int n) Get the fraction of a second to a set precision- Parameters:
n
- Number of decimal places- Returns:
- Fraction
-
getSign
public char getSign()Get the sign- Returns:
- Sign of the Angle
-
printSign
Get the sign as a String- Returns:
- Sign of the Angle
-
toString
Get the Angle as a String to a set precision- Parameters:
n
- Number of decimal places in fraction- Returns:
- The angle as a String in the form 'hh mm ss.f'
-
toString
Get the Angle as a String
-