|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.oness.common.all.BaseObject net.sf.oness.common.model.temporal.Date
Wrapper around a Calendar
object truncated to the field
specified (by default SECOND) using DateUtils.truncate(Calendar, int).
The MIN_VALUE and MAX_VALUE fields represent negative and positive infinity respectively, the implementation doesn't use Calendar.getMinimum or Calendar.getMaximum because the underlying database may not accept the range of values available in Calendar
Calendar
,
DateUtils.truncate(Calendar,int)
,
Serialized FormField Summary | |
protected java.util.Calendar |
calendar
Wrapped calendar |
static Date |
MAX_VALUE
The max value (actually 9999-DEC-31 23:59:59) |
static Date |
MIN_VALUE
The min value (actually 1000-JAN-01 00:00:00) |
Fields inherited from class net.sf.oness.common.all.BaseObject |
log |
Constructor Summary | |
Date()
Create Date not initialized. |
|
Date(java.util.Calendar calendar)
Create a date from a Calendar truncated to the default field DEFAULT_TRUNCATE_TO_FIELD leaving it as the most significant.
|
|
Date(java.util.Calendar calendar,
int truncateToField)
Create a date from a Calendar truncated to the field specified leaving it as the most significant. |
|
Date(int year,
int month,
int day)
Create a Date from year, month, day |
|
Date(int year,
int month,
int day,
int hour,
int minute,
int second)
Create a Date from year, month, day, hour, minute, second |
Method Summary | |
void |
addDays(int arg)
|
void |
addYears(int arg)
|
boolean |
after(Date when)
|
boolean |
before(Date when)
|
java.lang.Object |
clone()
|
int |
compareTo(java.lang.Object arg)
|
boolean |
equals(java.lang.Object o)
|
java.util.Calendar |
getCalendar()
Get the Calendar |
int |
getDayOfMonth()
|
int |
getMonth()
|
java.util.Date |
getTime()
Get this Time as a java.util.Date |
int |
getYear()
|
int |
hashCode()
|
static Date |
now()
Create a Date for the current time and truncated to the default field DEFAULT_TRUNCATE_TO_FIELD leaving it as the most significant. |
void |
setCalendar(java.util.Calendar calendar)
Set the Calendar |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final Date MIN_VALUE
public static final Date MAX_VALUE
protected java.util.Calendar calendar
Constructor Detail |
public Date()
public Date(int year, int month, int day, int hour, int minute, int second)
year
- month
- day
- hour
- minute
- second
- public Date(int year, int month, int day)
year
- month
- day
- public Date(java.util.Calendar calendar, int truncateToField)
calendar
- truncateToField
- public Date(java.util.Calendar calendar)
DEFAULT_TRUNCATE_TO_FIELD
leaving it as the most significant.
calendar
- Method Detail |
public static Date now()
DEFAULT_TRUNCATE_TO_FIELD
leaving it as the most significant.
public java.util.Calendar getCalendar()
Calendar wrapped by this object.
Changes to the Calendar will affect this date.
- Returns:
- the calendar
public void setCalendar(java.util.Calendar calendar)
Calendar wrapped by this object.
Changes to the Calendar will affect this date.
- Parameters:
calendar
-
public boolean after(Date when)
when
-
Calendar.after(java.lang.Object)
public boolean before(Date when)
when
-
Calendar.before(java.lang.Object)
public int compareTo(java.lang.Object arg)
compareTo
in interface java.lang.Comparable
arg
-
Date.compareTo(java.lang.Object)
public java.util.Date getTime()
java.util.Date object.
- Returns:
- See Also:
Calendar.getTime()
public void addDays(int arg)
public void addYears(int arg)
public int getYear()
public int getMonth()
public int getDayOfMonth()
public java.lang.String toString()
public boolean equals(java.lang.Object o)
Object.equals(java.lang.Object)
public int hashCode()
Object.hashCode()
public java.lang.Object clone()
Object.clone()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |