uk.ac.starlink.pal
Class palTime

java.lang.Object
  extended by uk.ac.starlink.pal.palTime

public class palTime
extends Object

Angle defined by Hour, minute, second and fraction of a second


Constructor Summary
palTime(int h, int m, int s)
          Angles defined by Hour, minute, second
palTime(int h, int m, int s, double frac)
          Angle defined by Hour, minute, second, fraction
palTime(int h, int m, int s, double frac, char c)
          Angle defined by Hour, minute, second, fraction and sign
 
Method Summary
 double getFraction()
          Get the fraction of a second
 int getFraction(int n)
          Get the fraction of a second to a set precision
 int getHour()
          Get the hour
 int getMin()
          Get the minute
 int getSec()
          Get the second
 char getSign()
          Get the sign
 String printSign()
          Get the sign as a String
 String toString()
          Get the Angle as a String
 String toString(int n)
          Get the Angle as a String to a set precision
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

palTime

public palTime(int h,
               int m,
               int s,
               double frac,
               char c)
Angle defined by Hour, minute, second, fraction and sign

Parameters:
h - Hour
m - Minute
s - Second
frac - Fraction of second
c - Sign ('+' or '-')

palTime

public palTime(int h,
               int m,
               int s,
               double frac)
Angle defined by Hour, minute, second, fraction

Parameters:
h - Hour
m - Minute
s - Second
frac - Fraction of second

palTime

public palTime(int h,
               int m,
               int s)
Angles defined by Hour, minute, second

Parameters:
h - Hour
m - Minute
s - Second
Method Detail

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

public String printSign()
Get the sign as a String

Returns:
Sign of the Angle

toString

public String toString(int n)
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

public String toString()
Get the Angle as a String

Overrides:
toString in class Object
Returns:
The angle as a String in the form 'hh:mm:ss.ff'


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.