utility
Class JulianDate

java.lang.Object
  extended by utility.JulianDate

public class JulianDate
extends java.lang.Object


Field Summary
 int day
           
 int hour
           
static int IGREG
           
 double jd
           
 int minute
           
 int month
           
static int SEC_IN_DAY
           
 int second
           
 int year
           
 
Constructor Summary
JulianDate()
          Create a JulianDate object with the current day and time
JulianDate(java.util.Date date)
           
JulianDate(double d)
           
JulianDate(int day, int month, int year)
           
JulianDate(int second, int minute, int hour, int day, int month, int year)
           
 
Method Summary
static double convert(int sec, int min, int hour, int day, int month, int year)
          converts from sec-min-hr-day-mon-yr to julian date.
static double convert2(int second, int minute, int hour, int day, int month, int year)
          converts from sec-min-hr-day-mon-yr to julian date.
 int getDay()
           
 int getHour()
           
 double getJD()
           
 int getMinute()
           
 int getMonth()
           
 int getSecond()
           
 java.util.Date getTime()
          returns a Date object
 int getYear()
           
 void setJD(double jd)
           
 java.util.Date toDate()
          returns a Date object
 java.lang.String toString()
          returns the decimal julian date as a String
 void updateFields()
          given a jd, calculates the year, month, day, hour, min, and sec.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

jd

public double jd

day

public int day

month

public int month

year

public int year

hour

public int hour

minute

public int minute

second

public int second

IGREG

public static final int IGREG
See Also:
Constant Field Values

SEC_IN_DAY

public static final int SEC_IN_DAY
See Also:
Constant Field Values
Constructor Detail

JulianDate

public JulianDate()
Create a JulianDate object with the current day and time


JulianDate

public JulianDate(double d)

JulianDate

public JulianDate(int day,
                  int month,
                  int year)

JulianDate

public JulianDate(int second,
                  int minute,
                  int hour,
                  int day,
                  int month,
                  int year)

JulianDate

public JulianDate(java.util.Date date)
Method Detail

convert2

public static double convert2(int second,
                              int minute,
                              int hour,
                              int day,
                              int month,
                              int year)
converts from sec-min-hr-day-mon-yr to julian date. perhaps less accurate than convert, but good for any date


convert

public static double convert(int sec,
                             int min,
                             int hour,
                             int day,
                             int month,
                             int year)
converts from sec-min-hr-day-mon-yr to julian date. This is the converter used internaly. Only good for 1900 -- 2100.


toString

public java.lang.String toString()
returns the decimal julian date as a String

Overrides:
toString in class java.lang.Object

toDate

public java.util.Date toDate()
returns a Date object


getTime

public java.util.Date getTime()
returns a Date object


updateFields

public void updateFields()
given a jd, calculates the year, month, day, hour, min, and sec. changes the field values accordingly


getJD

public double getJD()

getDay

public int getDay()

getMonth

public int getMonth()

getYear

public int getYear()

getHour

public int getHour()

getMinute

public int getMinute()

getSecond

public int getSecond()

setJD

public void setJD(double jd)