Interface Time
- All Superinterfaces:
Comparable<Time>, OsidPrimitive, Serializable
- All Known Subinterfaces:
Time
Supplements the OSID Time interface for Java.
-
Method Summary
Modifier and TypeMethodDescriptionintCompares this Time with the specified Time to determine the natural order.Time[]Returns an interval based on this Time derived by its granularity.booleanDetermines if the givenTimeis equal to this one.inthashCode()Returns a hash code value for thisTimebased on the types, values, and granularity.booleanisExclusive(Time t) Tests if the range of this Time, as specified by its granularity, does not overlap the given Time.booleanTests if this Time is greater than the given Time.booleanisInclusive(Time t) Tests if the range of this Time, as specified by its granularity, includes the given Time ranged by its grabularity.booleanTests if this Time is less than the given Time.Methods inherited from interface OsidPrimitive
toString
-
Method Details
-
isGreater
Tests if this Time is greater than the given Time. A greater Time is one whose values is greater than another plus its granularity.- Parameters:
t- the time to compare- Returns:
trueif this time is larger,falseotherwise- Throws:
NullArgumentException-tisnullUnsupportedException- cannot compare calendar
-
isLess
Tests if this Time is less than the given Time. A lesser Time is one whose values plus granularity is less than another minus its granularity.- Parameters:
t- the time to compare- Returns:
trueif this time is less,falseotherwise- Throws:
NullArgumentException-tisnullUnsupportedException- cannot compare calendar
-
isInclusive
Tests if the range of this Time, as specified by its granularity, includes the given Time ranged by its grabularity.- Parameters:
t- the time to compare- Returns:
trueif this time includes the given time,falseotherwise- Throws:
NullArgumentException-tisnullUnsupportedException- cannot compare calendar
-
isExclusive
Tests if the range of this Time, as specified by its granularity, does not overlap the given Time. If either time has an uncertainty of infinity this method returns false.- Parameters:
t- the time to compare- Returns:
trueif this time is excluded,falseotherwise- Throws:
NullArgumentException-tisnullUnsupportedException- cannot compare calendar
-
denormalizeTime
Time[] denormalizeTime()Returns an interval based on this Time derived by its granularity.- Returns:
trueif this time is excluded,falseotherwise
-
compareTo
Compares this Time with the specified Time to determine the natural order. Returns a negative integer, zero, or a positive integer as this time is less than, equal to, or greater than the specified time. The natural ordering is determined first by the natural ordering of the time scheme, then by its components. This method is not useful for numeric comparisons. The ranges implied by the granularities may overlap in such a way that two unequal Times may be neither less than or greater than the other. IfcompareToan time is zero, thenequals()must betrueand their hash codes must also be equal for consistent behavior. For orderings that may yield inconsistent behavior, an externalComparatorshould be used.- Specified by:
compareToin interfaceComparable<Time>- Parameters:
time- the time to be compared- Returns:
- a negative integer, zero, or a positive integer as this time is less than, equal to, or greater than the specified time
- Throws:
UnsupportedException- cannot compare calendar
-
equals
-
hashCode
-