| Modifier and Type | Field and Description |
|---|---|
| private final long | leading
Non-negative long with value of leading field. |
| private final boolean | negative
|
| private final IntervalQualifier | |
| private final long | remaining
Non-negative long with combined value of all remaining field, or 0 for single-field intervals, with exception for INTERVAL SECOND that uses this field to store fractional part of seconds measured in nanoseconds. |
| Access | Constructor and Description |
|---|---|
| public | Interval(IntervalQualifier
qualifier qualifier, boolean whether interval is negative negative, long value of leading field leading, long combined value of all remaining fields remaining)Creates a new interval. |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. obj)Overrides java. Indicates whether some other object is "equal to" this one. |
| public long | |
| public long | |
| public long | |
| public long | |
| public long | |
| public long | Returns: nanoseconds, or 0Returns value of fractional part of seconds (in nanoseconds), if any. |
| public IntervalQualifier | |
| public long | Returns: combined value of remaining fieldsReturns combined value of remaining fields of this interval. |
| public long | |
| public long | Returns: nanoseconds (including seconds), or 0Returns seconds value measured in nanoseconds, if any. |
| public long | |
| public int | |
| public boolean | |
| public static Interval | |
| public static Interval | Returns: INTERVAL DAY TO HOURdays, |days|<1018 days, int hours, |hours|<24 hours)Creates a new INTERVAL DAY TO HOUR. |
| public static Interval | Returns: INTERVAL DAY TO MINUTEdays, |days|<1018 days, int hours, |hours|<24 hours, int minutes, |minutes|<60 minutes)Creates a new INTERVAL DAY TO MINUTE. |
| public static Interval | Returns: INTERVAL DAY TO SECONDdays, |days|<1018 days, int hours, |hours|<24 hours, int minutes, |minutes|<60 minutes, long nanoseconds, |nanos|<60,000,000,000 nanos)Creates a new INTERVAL DAY TO SECOND. |
| public static Interval | Returns: INTERVAL DAY TO SECONDdays, |days|<1018 days, int hours, |hours|<24 hours, int minutes, |minutes|<60 minutes, int seconds, |seconds|<60 seconds)Creates a new INTERVAL DAY TO SECOND. |
| public static Interval | |
| public static Interval | Returns: INTERVAL HOUR TO MINUTEhours, |hours|<1018 hours, int minutes, |minutes|<60 minutes)Creates a new INTERVAL HOUR TO MINUTE. |
| public static Interval | Returns: INTERVAL HOUR TO SECONDhours, |hours|<1018 hours, int minutes, |minutes|<60 minutes, long nanoseconds, |seconds|<60,000,000,000 nanos)Creates a new INTERVAL HOUR TO SECOND. |
| public static Interval | Returns: INTERVAL HOUR TO SECONDhours, |hours|<1018 hours, int minutes, |minutes|<60 minutes, int seconds, |seconds|<60 seconds)Creates a new INTERVAL HOUR TO SECOND. |
| public static Interval | |
| public static Interval | Returns: INTERVAL MINUTE TO SECONDminutes, |minutes|<1018 minutes, long nanoseconds, |nanos|<60,000,000,000 nanos)Creates a new INTERVAL MINUTE TO SECOND. |
| public static Interval | Returns: INTERVAL MINUTE TO SECONDminutes, |minutes|<1018 minutes, int seconds, |seconds|<60 seconds)Creates a new INTERVAL MINUTE TO SECOND. |
| public static Interval | |
| public static Interval | Returns: INTERVAL SECONDnanoseconds (including seconds) nanos)Creates a new INTERVAL SECOND. |
| public static Interval | Returns: INTERVAL SECONDseconds, |seconds|<1018 seconds)Creates a new INTERVAL SECOND. |
| public static Interval | Returns: INTERVAL SECONDseconds, |seconds|<1018 seconds, int nanoseconds, |nanos|<1,000,000,000 nanos)Creates a new INTERVAL SECOND. |
| public static Interval | |
| public static Interval | Returns: INTERVAL YEAR TO MONTHyears, |years|<1018 years, int months, |months|<12 months)Creates a new INTERVAL YEAR TO MONTH. |
| public String |
| leading | back to summary |
|---|---|
| private final long leading Non-negative long with value of leading field. For INTERVAL SECOND contains only integer part of seconds. | |
| negative | back to summary |
|---|---|
| private final boolean negative
| |
| qualifier | back to summary |
|---|---|
| private final IntervalQualifier qualifier | |
| remaining | back to summary |
|---|---|
| private final long remaining Non-negative long with combined value of all remaining field, or 0 for single-field intervals, with exception for INTERVAL SECOND that uses this field to store fractional part of seconds measured in nanoseconds. | |
| Interval | back to summary |
|---|---|
| public Interval(IntervalQualifier qualifier, boolean negative, long leading, long remaining) Creates a new interval. Do not use this constructor, use static methods instead.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getDays | back to summary |
|---|---|
| public long getDays() Returns days value, if any.
| |
| getHours | back to summary |
|---|---|
| public long getHours() Returns hours value, if any.
| |
| getLeading | back to summary |
|---|---|
| public long getLeading() Returns value of leading field of this interval. For
| |
| getMinutes | back to summary |
|---|---|
| public long getMinutes() Returns minutes value, if any.
| |
| getMonths | back to summary |
|---|---|
| public long getMonths() Returns months value, if any.
| |
| getNanosOfSecond | back to summary |
|---|---|
| public long getNanosOfSecond() Returns value of fractional part of seconds (in nanoseconds), if any.
| |
| getQualifier | back to summary |
|---|---|
| public IntervalQualifier getQualifier() Returns qualifier of this interval.
| |
| getRemaining | back to summary |
|---|---|
| public long getRemaining() Returns combined value of remaining fields of this interval. For
| |
| getSeconds | back to summary |
|---|---|
| public long getSeconds() Returns value of integer part of seconds, if any.
| |
| getSecondsAndNanos | back to summary |
|---|---|
| public long getSecondsAndNanos() Returns seconds value measured in nanoseconds, if any.
This method returns a long value that cannot fit all possible values of
INTERVAL SECOND. For a very large intervals of this type use
| |
| getYears | back to summary |
|---|---|
| public long getYears() Returns years value, if any.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| isNegative | back to summary |
|---|---|
| public boolean isNegative() Returns where the interval is negative.
| |
| ofDays | back to summary |
|---|---|
| public static Interval ofDays(long days) Creates a new INTERVAL DAY.
| |
| ofDaysHours | back to summary |
|---|---|
| public static Interval ofDaysHours(long days, int hours) Creates a new INTERVAL DAY TO HOUR. If both arguments are not equal to zero they should have the same sign.
| |
| ofDaysHoursMinutes | back to summary |
|---|---|
| public static Interval ofDaysHoursMinutes(long days, int hours, int minutes) Creates a new INTERVAL DAY TO MINUTE. Non-zero arguments should have the same sign.
| |
| ofDaysHoursMinutesNanos | back to summary |
|---|---|
| public static Interval ofDaysHoursMinutesNanos(long days, int hours, int minutes, long nanos) Creates a new INTERVAL DAY TO SECOND. Non-zero arguments should have the same sign.
| |
| ofDaysHoursMinutesSeconds | back to summary |
|---|---|
| public static Interval ofDaysHoursMinutesSeconds(long days, int hours, int minutes, int seconds) Creates a new INTERVAL DAY TO SECOND. Non-zero arguments should have the same sign.
| |
| ofHours | back to summary |
|---|---|
| public static Interval ofHours(long hours) Creates a new INTERVAL HOUR.
| |
| ofHoursMinutes | back to summary |
|---|---|
| public static Interval ofHoursMinutes(long hours, int minutes) Creates a new INTERVAL HOUR TO MINUTE. If both arguments are not equal to zero they should have the same sign.
| |
| ofHoursMinutesNanos | back to summary |
|---|---|
| public static Interval ofHoursMinutesNanos(long hours, int minutes, long nanos) Creates a new INTERVAL HOUR TO SECOND. Non-zero arguments should have the same sign.
| |
| ofHoursMinutesSeconds | back to summary |
|---|---|
| public static Interval ofHoursMinutesSeconds(long hours, int minutes, int seconds) Creates a new INTERVAL HOUR TO SECOND. Non-zero arguments should have the same sign.
| |
| ofMinutes | back to summary |
|---|---|
| public static Interval ofMinutes(long minutes) Creates a new INTERVAL MINUTE.
| |
| ofMinutesNanos | back to summary |
|---|---|
| public static Interval ofMinutesNanos(long minutes, long nanos) Creates a new INTERVAL MINUTE TO SECOND. If both arguments are not equal to zero they should have the same sign.
| |
| ofMinutesSeconds | back to summary |
|---|---|
| public static Interval ofMinutesSeconds(long minutes, int seconds) Creates a new INTERVAL MINUTE TO SECOND. If both arguments are not equal to zero they should have the same sign.
| |
| ofMonths | back to summary |
|---|---|
| public static Interval ofMonths(long months) Creates a new INTERVAL MONTH.
| |
| ofNanos | back to summary |
|---|---|
| public static Interval ofNanos(long nanos) Creates a new INTERVAL SECOND.
| |
| ofSeconds | back to summary |
|---|---|
| public static Interval ofSeconds(long seconds) Creates a new INTERVAL SECOND.
| |
| ofSeconds | back to summary |
|---|---|
| public static Interval ofSeconds(long seconds, int nanos) Creates a new INTERVAL SECOND. If both arguments are not equal to zero they should have the same sign.
| |
| ofYears | back to summary |
|---|---|
| public static Interval ofYears(long years) Creates a new INTERVAL YEAR.
| |
| ofYearsMonths | back to summary |
|---|---|
| public static Interval ofYearsMonths(long years, int months) Creates a new INTERVAL YEAR TO MONTH. If both arguments are not equal to zero they should have the same sign.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |