Hvordan forstås javadoc
Jeg er ret ny til java, og jeg har problemer med at omsætte beskrivelsen i doc til egentlig kode.Mit spørgsmål er:
Hvordan får jeg omdannet nedenståede til en kode, der giver mig julian date.
Jeg har en Javadoc Constructor Detail der ser således ud:
AstroDate
public AstroDate()Default constructor = epoch J2000 (noon on 1/1/2000)
--------------------------------------------------------------------------------
AstroDate
public AstroDate(int day,
int month,
int year,
int seconds)Literal (member by member) constructor
Parameters:
day - Day of the month (1...31)
month - Month of the year (1..12)
year - Year
Hertil hører en method som er således ud:
Method Detail
jd
public static double jd(AstroDate ad,
boolean julian)Convert an AstroDate to a Julian Day.
Parameters:
ad - The date to convert
julian - true = Julian calendar, else Gregorian
Returns:
The Julian Day that corresponds to the specified AstroDate
Derudover er der en række andre oplysninger i dokumentet:
Constructor Summary
AstroDate()
Default constructor = epoch J2000 (noon on 1/1/2000)
AstroDate(double jd)
Julian Day constructor.
AstroDate(int day, int month, int year)
Day, Month, Year constructor (time defaults to 00:00:00 = midnight)
AstroDate(int day, int month, int year, double dayFraction)
Day, Month, Year + fraction of a day constructor
AstroDate(int day, int month, int year, int seconds)
Literal (member by member) constructor
AstroDate(int day, int month, int year, int hour, int min, int sec)
Explicit day, month, year, hour, minute, and second constructor
Method Summary
int day()
Get the day.
int hour()
Get the Hour.
int hourRound()
Get the rounded hour.
double jd()
Convert this instance of AstroDate to a Julian Day.
static double jd(AstroDate ad)
Convert an AstroDate to a Julian Day.
static double jd(AstroDate ad, boolean julian)
Convert an AstroDate to a Julian Day.
double jd(boolean julian)
Convert this instance of AstroDate to a Julian Day.
static void main(java.lang.String[] args)
(for unit testing only)
int minute()
Get the minute.
int minuteRound()
Get the rounded minute.
int month()
Get the month.
int second()
Get the second.
java.util.GregorianCalendar toGCalendar()
Convert this AstroDate instance to a GregorianCalendar.
java.lang.String toMinString()
Convert this AstroDate instance to a String, formatted to the minute.
java.lang.String toMinStringTZ()
Convert this AstroDate instance to a String formatted to the minute, with Time Zone indicator.
java.lang.String toString()
Convert this AstroDate instance to a String.
java.lang.String toStringTZ()
Convert this AstroDate instance to a String, with Time Zone indicator.
int year()
Get the year.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
