public interface DateTime extends OsidPrimitive, java.lang.Comparable<DateTime>
Modifier and Type | Method and Description |
---|---|
int |
compareTo(DateTime datetime)
Compares this datetime with the specified
DateTime
to determine the natural order. |
DateTimeInterval |
denormalize()
Returns an interval based on this DateTime derived by its
granularity and uncertainty.
|
boolean |
equals(java.lang.Object obj)
Determines if the given
DateTime is equal to
this one. |
int |
hashCode()
Returns a hash code value for this
DateTime based
on the types, values, granularity and uncertainties. |
boolean |
isExclusive(DateTime datetime)
Tests if the range of this DateTime, as specified by its
granularity and uncertainty, does not overlap the given
DateTime.
|
boolean |
isGreater(DateTime datetime)
Tests if this DateTime is greater than the given DateTime.
|
boolean |
isInclusive(DateTime datetime)
Tests if the range of this DateTime, as specified by its
granularity and uncertainty, includes the given DateTime
ranged by its grabularity and uncertainty.
|
boolean |
isLess(DateTime datetime)
Tests if this DateTime is less than the given DateTime.
|
toString
boolean isGreater(DateTime datetime)
datetime
- the datetime to comparetrue
if this datetime is larger,
false
otherwiseNullArgumentException
- datetime
is null
UnsupportedException
- cannot compare calendarboolean isLess(DateTime datetime)
datetime
- the datetime to comparetrue
if this datetime is less,
false
otherwiseNullArgumentException
- datetime
is null
UnsupportedException
- cannot compare calendarboolean isInclusive(DateTime datetime)
datetime
- the datetime to comparetrue
if this datetime includes the given
datetime, false
otherwiseNullArgumentException
- datetime
is null
UnsupportedException
- cannot compare calendarboolean isExclusive(DateTime datetime)
datetime
- the datetime to comparetrue
if this datetime is excluded,
false
otherwiseNullArgumentException
- datetime
is null
UnsupportedException
- cannot compare calendarDateTimeInterval denormalize()
true
if this datetime is excluded,
false
otherwiseint compareTo(DateTime datetime)
DateTime
to determine the natural order. Returns a negative integer,
zero, or a positive integer as this datetime is less than, equal
to, or greater than the specified datetime.
The natural ordering is determined first by the natural
ordering of the calendar and time types, then by its
values. This method is not useful for numeric comparisons. The
ranges implied by their granularities and uncertainties may
overlap in such a way that two unequal DateTimes may be
neither less than or greater than the other.
If compareTo
a datetime is zero, then
equals()
must be true
and their hash
codes must also be equal for consistent behavior. For
orderings that may yield inconsistent behavior, an external
Comparator
should be used.compareTo
in interface java.lang.Comparable<DateTime>
datetime
- the datetime to be comparedjava.lang.ClassCastException
- if the specified datetime's type
prevents it from being compared to this datetimeboolean equals(java.lang.Object obj)
DateTime
is equal to
this one. Two DateTimes are equal if their Types, values,
granularity, and uncertainties are equal.equals
in class java.lang.Object
obj
- an object to compare true
if the given object is equal to
this DateTime
, false
otherwiseint hashCode()
DateTime
based
on the types, values, granularity and uncertainties.hashCode
in class java.lang.Object