|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.Date tribble.util.Date
public class Date
Immutable date/time value.
This class is identical to the standard java.util.Date class, except
that its contents cannot be changed. Specifically, the
setTime()
method does not modify the object's value, but
instead throws an exception. For all other purposes, objects of this type can
be used anywhere java.util.Date objects are used.
Methods can return objects of this type as immutable values, i.e., the date objects cannot be modified after they are returned.
In addition, the special constants UNKNOWN
and NEVER
are
provided which represent, respectively, an unknown date and a date that will
never occur.
Field Summary | |
---|---|
static Date |
NEVER
Special date value: Never. |
static long |
TIME_NEVER
Special time value: Never. |
static long |
TIME_UNKNOWN
Special time value: Unknown. |
static Date |
UNKNOWN
Special date value: Unknown. |
Constructor Summary | |
---|---|
Date()
Default constructor. |
|
Date(java.util.Date date)
Constructor. |
|
Date(long time)
Constructor. |
Method Summary | |
---|---|
boolean |
after(java.util.Date when)
Determine if this date occurs after a specified date. |
boolean |
before(java.util.Date when)
Determine if this date occurs before a specified date. |
void |
setTime(long time)
This method is not implemented. |
java.lang.String |
toString()
Convert this date into its equivalent string representation. |
Methods inherited from class java.util.Date |
---|
clone, compareTo, equals, getDate, getDay, getHours, getMinutes, getMonth, getSeconds, getTime, getTimezoneOffset, getYear, hashCode, parse, setDate, setHours, setMinutes, setMonth, setSeconds, setYear, toGMTString, toLocaleString, UTC |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final long TIME_UNKNOWN
public static final long TIME_NEVER
public static final Date UNKNOWN
public static final Date NEVER
Constructor Detail |
---|
public Date()
public Date(long time)
time
- A time value, measured in milliseconds since
1970-01-01 00:00:00.000 UTC.public Date(java.util.Date date)
date
- A date value.Method Detail |
---|
public java.lang.String toString()
If this date is equal to UNKNOWN
, the string returned is
"unknown".
If this date is equal to NEVER
, the string returned is
"never".
Otherwise the string returned is of the form:
"dow mon dd hh:mm:ss zzz yyyy"where:
toString
in class java.util.Date
public boolean after(java.util.Date when)
Dates equal to UNKNOWN
occur before any other valid date, and
dates equal to NEVER
occur after any other valid date.
after
in class java.util.Date
when
- Another date to compare to this one.
public boolean before(java.util.Date when)
Dates equal to UNKNOWN
occur before any other valid date, and
dates equal to NEVER
occur after any other valid date.
before
in class java.util.Date
when
- Another date to compare to this one.
public void setTime(long time)
setTime
in class java.util.Date
java.lang.UnsupportedOperationException
- (unchecked)
Thrown always, indicating that this method is not implemented.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |