Package org.apache.xmlbeans
Interface GDurationSpecification
- All Known Implementing Classes:
GDuration,GDurationBuilder
public interface GDurationSpecification
Represents an XML Schema-compatible duration.
Both the immutable GDuration and the mutable GDurationBuilder are GDurationSpecifications. Use this interface where you want to allow callers to pass any implementation of a GDuration.
- See Also:
GDuration
-
Method Summary
Modifier and Type Method Description intcompareToGDuration(GDurationSpecification duration)Comparison to another GDuration.intgetDay()Gets the day-of-month component.BigDecimalgetFraction()Gets the fraction-of-second.intgetHour()Gets the hour-of-day component.intgetMinute()Gets the minute-of-hour component.intgetMonth()Gets the month-of-year component.intgetSecond()Gets the second-of-minute component.intgetSign()Returns the sign of the duration: +1 is forwards and -1 is backwards in time.intgetYear()Gets the year component.booleanisImmutable()True if this instance is immutable.booleanisValid()Returns true if all of the individual components of the duration are nonnegative.
-
Method Details
-
isImmutable
boolean isImmutable()True if this instance is immutable. -
getSign
int getSign()Returns the sign of the duration: +1 is forwards and -1 is backwards in time. -
getYear
int getYear()Gets the year component. -
getMonth
int getMonth()Gets the month-of-year component. -
getDay
int getDay()Gets the day-of-month component. -
getHour
int getHour()Gets the hour-of-day component. -
getMinute
int getMinute()Gets the minute-of-hour component. -
getSecond
int getSecond()Gets the second-of-minute component. -
getFraction
BigDecimal getFraction()Gets the fraction-of-second. Range from 0 (inclusive) to 1 (exclusive). -
isValid
boolean isValid()Returns true if all of the individual components of the duration are nonnegative. -
compareToGDuration
Comparison to another GDuration.- Returns -1 if this < duration. (less-than)
- Returns 0 if this == duration. (equal)
- Returns 1 if this > duration. (greater-than)
- Returns 2 if this <> duration. (incomparable)
-