public class FullDate
extends java.lang.Object
| Constructor and Description |
|---|
FullDate(FullDate date)
Class copy constructor
|
FullDate(int year,
int month,
int day)
Class constructor, given the year, the month and the day of the date.
|
FullDate(java.lang.String date,
java.lang.String delimiter)
Class constructor, given a string representation of the date.
|
FullDate(java.lang.String date,
java.lang.String delimiter,
boolean dayToYear)
Class constructor, given a string representation of the date.
|
| Modifier and Type | Method and Description |
|---|---|
void |
advance()
Moves to the next day.
|
FullDate |
clone()
Returns a copy of the object.
|
int |
CompareDates(FullDate d)
Compares this object to another query FullDate object
|
static FullDate |
convertFromMJD(double mjd) |
int |
getDay()
Gets the day.
|
int |
getDaysFromStartOfYear()
Returns the number of days since the January 1st of the year in this FullDate object
|
int |
getDaysInMonth()
Returns the number of days in the month in this FullDate object
|
int |
getMonth()
Gets the month.
|
FullDate |
getNextDay()
Returns a new object that corresponds to the next day.
|
FullDate |
getPreviousDay()
Returns a new object that corresponds to the previous day.
|
int |
getYear()
Gets the year.
|
static FullDate |
parseFromCompactStr(java.lang.String str)
Create a FullDate object from a YYYYMMDD string.
|
void |
recede()
Moves to the previous day.
|
void |
setDay(int day)
Sets the day.
|
void |
setMonth(int month)
Sets the month.
|
void |
setYear(int year)
Sets the year
|
java.lang.String |
toString()
Returns a string representation of this object in yyyy/mm/dd format
|
java.lang.String |
toString(java.lang.String del)
Returns a string representation of this object with the specified delimiter separating year, month and day digits.
|
java.lang.String |
toStringCompact()
Returns a string representation of this object in yyyymmdd format
|
java.lang.String |
toStringReverse()
Returns a string representation of this object in dd/mm/yyyy format
|
public FullDate(int year,
int month,
int day)
throws java.lang.IllegalArgumentException
year - month - day - java.lang.IllegalArgumentException - in case the combination of the arguments is not a valid datepublic FullDate(FullDate date)
date - public FullDate(java.lang.String date,
java.lang.String delimiter)
throws java.lang.NumberFormatException,
java.lang.IllegalArgumentException
date - the string representation of the date. Must be in yyyy%mm%dd format, where % is a delimiter character. The use of a three letter representation of the month, instead of mm is also acceptable.delimiter - the delimiter character, usually "/"java.lang.NumberFormatException - in case one of the numerical values cannot be parsedjava.lang.IllegalArgumentException - in case the date is not in correct format or does not provide a valid datepublic FullDate(java.lang.String date,
java.lang.String delimiter,
boolean dayToYear)
throws java.lang.NumberFormatException,
java.lang.IllegalArgumentException
date - the string representation of the date. Must be in yyyy%mm%dd or dd%mm%yyyy format, where % is a delimiter character. The sequence is defined by the dayToYear argument.delimiter - the delimiter character, usually "/"dayToYear - defines whether the sequence is in yyyy%mm%dd or dd%mm%yyyy formatjava.lang.NumberFormatException - in case one of the numerical values cannot be parsedjava.lang.IllegalArgumentException - in case the date is not in correct format or does not provide a valid datepublic static FullDate parseFromCompactStr(java.lang.String str)
str - public int getDay()
public int getMonth()
public int getYear()
public void setDay(int day)
throws java.lang.IllegalArgumentException
day - java.lang.IllegalArgumentException - in case the day is not within the range of valid days (according to the month)public void setMonth(int month)
throws java.lang.IllegalArgumentException
month - java.lang.IllegalArgumentException - in case the month is not within the range 1-12public void setYear(int year)
throws java.lang.IllegalArgumentException
year - java.lang.IllegalArgumentException - in case the year is smaller than 1700public FullDate clone()
clone in class java.lang.Objectpublic FullDate getNextDay()
public FullDate getPreviousDay()
public void advance()
public void recede()
public int CompareDates(FullDate d)
d - the object to be comparedpublic int getDaysFromStartOfYear()
public int getDaysInMonth()
public java.lang.String toString()
toString in class java.lang.Objectpublic java.lang.String toString(java.lang.String del)
del - public java.lang.String toStringReverse()
public java.lang.String toStringCompact()
public static FullDate convertFromMJD(double mjd)