Whenever you need additional information about an epoch as defined by
the class JulianTime you may introduce another class called CalendarDate.
There already exists a predefined class Date in Java and it does nearly
all you may expect it to do. At least as long as you stay within the era
of the Gregorian Calendar, which is valid since 15th of October, 1582.
In Astronomy you often have to deal with epochs before that date. As you've
already seen when reading about class JulianTime there exists a simple
enumeration technique, called the julian date or julian day number. Joseph
Justus Scaliger (1540-1609) proposed this kind of astronomical date starting
at the first of January in the year 4713 before Christ at noon (!). He
named it "Julian Day" to honor his father Julius Cesar Scaliger.
CalendarDate extends JulianTime. That means, class CalendarDate inherits
data and methods from class JulianTime. In addition class CalendarDate
contains data describing calendar date by strings and numbers. Information
about the day of the year, the week of the year, the name of the day and
the date of Easter is present too.
Methods of class CalendarDate
| Set |
Like set of class JulianTime plus setting of additional data |
| public void set (); |
|
| public void set (long day, double sek); |
|
| public void set (double epoch); |
|
| public void set (JulianTime t); |
|
| public void set (String date, String time); |
|
| public void set (int day, int month, long year, int hour, int
minute, double second); |
|
| public void set (CalendarDate D); |
|
|
|
| Access Methods |
Access additional data |
| public String date (); |
{ return calendardate; } |
| public String time (); |
{ return calendartime; } |
| public int day (); |
{ return day; } |
| public int month (); |
{ return month; } |
| public long year (); |
{ return year; } |
| public int hour (); |
{ return hour; } |
| public int minute (); |
{ return minute; } |
| public double second (); |
{ return second; } |
|
|
| Info Methods |
Access additional information |
| public String dateInfo (); |
set and return dateinfo |
| public int daynumberOfWeek (); |
0=Sunday, 1=Monday, ..., 6=Saturday |
| public String dayOfWeek (); |
Sunday, Monday, ... (set and return dayofweek) |
| public int dayOfYear (); |
day of the year |
| public int weekOfYear (); |
week of the year |
| public boolean leapYear (); |
leap year (true or false) |
| public String dateOfEaster (); |
date of Easter (set and return eastersunday) |