| java.lang.Object org.jaffa.datatypes.DateOnly
Constructor Summary | |
public | DateOnly() Creates an instance with the current date. | public | DateOnly(long timeInMillis) Creates an instance initialized to the input value. | public | DateOnly(java.util.Date utilDate) Creates an instance initialized to the input value. | public | DateOnly(Calendar calendar) Creates an instance initialized to the input value. | public | DateOnly(int year, int month, int day) Creates an instance initialized to the input value. |
Method Summary | |
public static DateOnly | addDay(DateOnly date, int days) Create a new DateOnly object by adding the input days to the value of the input date.
If the input days is a negative number, then the days will be subtracted.
Parameters: date - the input date. Parameters: days - the days to add. | public static DateOnly | addMonth(DateOnly date, int months) Create a new DateOnly object by adding the input months to the value of the input date.
If the input months is a negative number, then the months will be subtracted.
Parameters: date - the input date. Parameters: months - the months to add. | public static DateOnly | addYear(DateOnly date, int years) Create a new DateOnly object by adding the input years to the value of the input date.
If the input years is a negative number, then the years will be subtracted.
Parameters: date - the input date. Parameters: years - the years to add. | public Object | clone() Returns a clone of the object.
throws: CloneNotSupportedException - if cloning is not supported. | public int | compareTo(Object obj) Compares this object with another DateOnly object.
Parameters: obj - the other DateOnly object. | public static int | daysBetween(DateOnly date1, DateOnly date2) Returns the number of days between two dates.
Parameters: date1 - the first date. Parameters: date2 - the second date. | public boolean | equals(Object obj) Compares this object with another DateOnly object.
Returns a true if both the objects have the same value.
Parameters: obj - the other DateOnly object. | public Calendar | getCalendar() Returns the Calendar. | public int | getDay() Returns the day. | public int | getDayOfWeek() Returns the day of the week. | public int | getDayOfWeekInMonth() Returns the day of the week in the month. | public int | getDayOfYear() Returns the day of the year. | public int | getFirstDayOfWeek() Returns the first day of the week. | public int | getJulian() Returns the corresponding julian value. | public int | getMonth() Returns the month. | public java.sql.Date | getSQLDate() Returns the value as a java.sql.Date object. | public Time | getSQLTime() Returns the value as a java.sql.Time object. | public long | getTime() Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this object. | public Timestamp | getTimestamp() Returns the value as a java.sql.Timestamp object. | public java.util.Date | getUtilDate() Returns the value as a java.util.Date object. | public int | getWeekOfMonth() Returns the week of the month. | public int | getWeekOfYear() Returns the week of the year. | public int | getYear() Returns the year. | public int | hashCode() Returns the hashCode of the value. | public boolean | isAfter(DateOnly when) Returns a true if this date is after the input date.
Parameters: when - the input date. | public boolean | isBefore(DateOnly when) Returns a true if this date is before the input date.
Parameters: when - the input date. | public static DateOnly | parse(String dateString) This parses the input String, returning a DateOnly object with the corresponding value.
The input String can have values of the type - N, N + 1, N - 6..., where N = current datetime.
It can also have values of the type - T, T - 1, T + 2..., where T = todays date.
Additionally the input String can be a formatted String based on the default layout of the DateOnlyFieldMetaData.
Parameters: dateString - the String to be parsed. | public static DateOnly | parse(String dateString, String layout) This parses the input String, returning a DateOnly object with the corresponding value.
The input String can have values of the type - N, N + 1, N - 6..., where N = current datetime.
It can also have values of the type - T, T - 1, T + 2..., where T = todays date.
Additionally the input String can be a formatted String based on the input layout or the default layout of the DateOnlyFieldMetaData.
Parameters: dateString - the String to be parsed. Parameters: layout - the format used by the input String. | public static DateTime | toDateTime(DateOnly date) Returns a DateTime object initialized to the input date.
Parameters: date - the input date. | public String | toString() Returns the diagnostic information. |
DateOnly | public DateOnly()(Code) | | Creates an instance with the current date.
|
DateOnly | public DateOnly(long timeInMillis)(Code) | | Creates an instance initialized to the input value.
Parameters: timeInMillis - the initial value. |
DateOnly | public DateOnly(java.util.Date utilDate)(Code) | | Creates an instance initialized to the input value.
Parameters: utilDate - the initial value. |
DateOnly | public DateOnly(Calendar calendar)(Code) | | Creates an instance initialized to the input value.
Parameters: calendar - the initial value. |
DateOnly | public DateOnly(int year, int month, int day)(Code) | | Creates an instance initialized to the input value.
Parameters: year - the year. Parameters: month - the month. Parameters: day - the day. |
addDay | public static DateOnly addDay(DateOnly date, int days)(Code) | | Create a new DateOnly object by adding the input days to the value of the input date.
If the input days is a negative number, then the days will be subtracted.
Parameters: date - the input date. Parameters: days - the days to add. a DateOnly object with the value of the input date, incremented by the input days. |
addMonth | public static DateOnly addMonth(DateOnly date, int months)(Code) | | Create a new DateOnly object by adding the input months to the value of the input date.
If the input months is a negative number, then the months will be subtracted.
Parameters: date - the input date. Parameters: months - the months to add. a DateOnly object with the value of the input date, incremented by the input months. |
addYear | public static DateOnly addYear(DateOnly date, int years)(Code) | | Create a new DateOnly object by adding the input years to the value of the input date.
If the input years is a negative number, then the years will be subtracted.
Parameters: date - the input date. Parameters: years - the years to add. a DateOnly object with the value of the input date, incremented by the input years. |
compareTo | public int compareTo(Object obj)(Code) | | Compares this object with another DateOnly object.
Parameters: obj - the other DateOnly object. a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. |
daysBetween | public static int daysBetween(DateOnly date1, DateOnly date2)(Code) | | Returns the number of days between two dates.
Parameters: date1 - the first date. Parameters: date2 - the second date. the number of days between two dates. |
equals | public boolean equals(Object obj)(Code) | | Compares this object with another DateOnly object.
Returns a true if both the objects have the same value.
Parameters: obj - the other DateOnly object. a true if both the objects have the same value. |
getCalendar | public Calendar getCalendar()(Code) | | Returns the Calendar.
the Calendar. |
getDay | public int getDay()(Code) | | Returns the day.
the day. |
getDayOfWeek | public int getDayOfWeek()(Code) | | Returns the day of the week.
the day of the week. |
getDayOfWeekInMonth | public int getDayOfWeekInMonth()(Code) | | Returns the day of the week in the month.
the day of the week in the month. |
getDayOfYear | public int getDayOfYear()(Code) | | Returns the day of the year.
the day of the year. |
getFirstDayOfWeek | public int getFirstDayOfWeek()(Code) | | Returns the first day of the week.
the first day of the week. |
getJulian | public int getJulian()(Code) | | Returns the corresponding julian value.
the corresponding julian value. |
getMonth | public int getMonth()(Code) | | Returns the month.
the month. |
getSQLDate | public java.sql.Date getSQLDate()(Code) | | Returns the value as a java.sql.Date object.
the value as a java.sql.Date object. |
getSQLTime | public Time getSQLTime()(Code) | | Returns the value as a java.sql.Time object.
the value as a java.sql.Time object. |
getTime | public long getTime()(Code) | | Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this object.
the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this object. |
getTimestamp | public Timestamp getTimestamp()(Code) | | Returns the value as a java.sql.Timestamp object.
the value as a java.sql.Timestamp object. |
getUtilDate | public java.util.Date getUtilDate()(Code) | | Returns the value as a java.util.Date object.
the value as a java.util.Date object. |
getWeekOfMonth | public int getWeekOfMonth()(Code) | | Returns the week of the month.
the week of the month. |
getWeekOfYear | public int getWeekOfYear()(Code) | | Returns the week of the year.
the week of the year. |
getYear | public int getYear()(Code) | | Returns the year.
the year. |
hashCode | public int hashCode()(Code) | | Returns the hashCode of the value.
the hashCode of the value. |
isAfter | public boolean isAfter(DateOnly when)(Code) | | Returns a true if this date is after the input date.
Parameters: when - the input date. a true if this date is after the input date. |
isBefore | public boolean isBefore(DateOnly when)(Code) | | Returns a true if this date is before the input date.
Parameters: when - the input date. a true if this date is before the input date. |
parse | public static DateOnly parse(String dateString) throws ParseException(Code) | | This parses the input String, returning a DateOnly object with the corresponding value.
The input String can have values of the type - N, N + 1, N - 6..., where N = current datetime.
It can also have values of the type - T, T - 1, T + 2..., where T = todays date.
Additionally the input String can be a formatted String based on the default layout of the DateOnlyFieldMetaData.
Parameters: dateString - the String to be parsed. a DateOnly object which has the value based on the input. throws: ParseException - if any error occurs in parsing. |
parse | public static DateOnly parse(String dateString, String layout) throws ParseException(Code) | | This parses the input String, returning a DateOnly object with the corresponding value.
The input String can have values of the type - N, N + 1, N - 6..., where N = current datetime.
It can also have values of the type - T, T - 1, T + 2..., where T = todays date.
Additionally the input String can be a formatted String based on the input layout or the default layout of the DateOnlyFieldMetaData.
Parameters: dateString - the String to be parsed. Parameters: layout - the format used by the input String. a DateOnly object which has the value based on the input. throws: ParseException - if any error occurs in parsing. |
toDateTime | public static DateTime toDateTime(DateOnly date)(Code) | | Returns a DateTime object initialized to the input date.
Parameters: date - the input date. a DateTime object initialized to the input date. |
toString | public String toString()(Code) | | Returns the diagnostic information.
the diagnostic information. |
|
|