| java.lang.Object org.jaffa.datatypes.DateBase
Constructor Summary | |
| DateBase() Creates an instance with the current datetime. | | DateBase(long timeInMillis) Creates an instance initialized to the input value. | | DateBase(java.util.Date utilDate) Creates an instance initialized to the input value. | | DateBase(Calendar calendar) Creates an instance initialized to the input value. | | DateBase(int year, int month, int day) Creates an instance initialized to the input value. | | DateBase(int year, int month, int day, int hourOfDay, int minute, int second, int milli) Creates an instance initialized to the input value. |
Method Summary | |
static DateBase | addDay(DateBase aDateBase, int days) | static DateBase | addHour(DateBase aDateBase, int hours) | static DateBase | addMilli(DateBase aDateBase, int millis) | static DateBase | addMinute(DateBase aDateBase, int minutes) | static DateBase | addMonth(DateBase aDateBase, int months) | static DateBase | addSecond(DateBase aDateBase, int seconds) | static DateBase | addYear(DateBase aDateBase, int years) | static DateBase | clearTime(DateBase aDateBase) | 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 DateBase object.
Parameters: obj - the other DateBase object. | static float | daysBetween(DateBase date1, DateBase date2) | public boolean | equals(Object obj) Compares this object with another DateBase object.
Returns a true if both the objects have the same value.
Parameters: obj - the other DateBase object. | Calendar | getCalendar() | int | getDay() | int | getDayOfWeek() | int | getDayOfWeekInMonth() | int | getDayOfYear() | int | getFirstDayOfWeek() | int | getHour() | int | getHourOfDay() | int | getJulian() The Julian day number that begins at noon ofthis dayPositive year signifies A.D., negative year B.C.Remember that the year after 1 B.C. | int | getMilli() | int | getMinute() | int | getMonth() | java.sql.Date | getSQLDate() | Time | getSQLTime() | int | getSecond() | long | getTime() | Timestamp | getTimestamp() | java.util.Date | getUtilDate() | int | getWeekOfMonth() | int | getWeekOfYear() | int | getYear() | public int | hashCode() Returns the hashCode of the value. | boolean | isAM() | boolean | isAfter(DateBase when) | boolean | isBefore(DateBase when) | boolean | isPM() | public static DateBase | parse(String dateString, String layout, boolean displayTime) This parses the input String, returning a DateBase 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.
If the layout is null, then the default values are used from DateTimeFieldMetaData(if displayTime is true),
or DateOnlyFieldMetaData.
Parameters: dateString - the String to be parsed. Parameters: layout - the format used by the input String. Parameters: displayTime - determines which Default layout is to be used for parsing. | public String | toString() Returns the diagnostic information. |
DateBase | DateBase()(Code) | | Creates an instance with the current datetime.
|
DateBase | DateBase(long timeInMillis)(Code) | | Creates an instance initialized to the input value.
|
DateBase | DateBase(java.util.Date utilDate)(Code) | | Creates an instance initialized to the input value.
|
DateBase | DateBase(Calendar calendar)(Code) | | Creates an instance initialized to the input value.
|
DateBase | DateBase(int year, int month, int day)(Code) | | Creates an instance initialized to the input value.
|
DateBase | DateBase(int year, int month, int day, int hourOfDay, int minute, int second, int milli)(Code) | | Creates an instance initialized to the input value.
|
compareTo | public int compareTo(Object obj)(Code) | | Compares this object with another DateBase object.
Parameters: obj - the other DateBase object. a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. |
equals | public boolean equals(Object obj)(Code) | | Compares this object with another DateBase object.
Returns a true if both the objects have the same value.
Parameters: obj - the other DateBase object. a true if both the objects have the same value. |
getDayOfWeek | int getDayOfWeek()(Code) | | |
getDayOfWeekInMonth | int getDayOfWeekInMonth()(Code) | | |
getDayOfYear | int getDayOfYear()(Code) | | |
getFirstDayOfWeek | int getFirstDayOfWeek()(Code) | | |
getHourOfDay | int getHourOfDay()(Code) | | |
getJulian | int getJulian()(Code) | | The Julian day number that begins at noon ofthis dayPositive year signifies A.D., negative year B.C.Remember that the year after 1 B.C. was 1 A.D.A convenient reference point is that May 23, 1968 noonis Julian day 2440000.Julian day 0 is a Monday.This algorithm is from Press et al., Numerical Recipesin C, 2nd ed., Cambridge University Press 1992 |
getMinute | int getMinute()(Code) | | |
getSecond | int getSecond()(Code) | | |
getWeekOfMonth | int getWeekOfMonth()(Code) | | |
getWeekOfYear | int getWeekOfYear()(Code) | | |
hashCode | public int hashCode()(Code) | | Returns the hashCode of the value.
the hashCode of the value. |
parse | public static DateBase parse(String dateString, String layout, boolean displayTime) throws ParseException(Code) | | This parses the input String, returning a DateBase 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.
If the layout is null, then the default values are used from DateTimeFieldMetaData(if displayTime is true),
or DateOnlyFieldMetaData.
Parameters: dateString - the String to be parsed. Parameters: layout - the format used by the input String. Parameters: displayTime - determines which Default layout is to be used for parsing. a DateBase object which has the value based on the input. throws: ParseException - if any error occurs in parsing. |
toString | public String toString()(Code) | | Returns the diagnostic information.
the diagnostic information. |
|
|