- All Implemented Interfaces:
- Serializable,- Comparable<DayToSecond>,- Interval
INTERVAL DAY TO SECOND
 data type.
 
 DayToSecond is a Number whose Number.intValue()
 represents the (truncated) number of milliseconds of the interval,
 Number.doubleValue() represents the approximative number of
 milliseconds (including hours, minutes, seconds, nanoseconds) of the
 interval.
 
 Note: only a few databases actually support this data type on its own. You
 can still use it for date time arithmetic in other databases, though, through
 Field.add(Field) and Field.sub(Field) Databases that have
 been observed to natively support INTERVAL data types are:
 
 These dialects have been observed to partially support INTERVAL
 data types in date time arithmetic functions, such as
 TIMESTAMPADD, and TIMESTAMPDIFF:
 
- Author:
- Lukas Eder
- See Also:
- 
Constructor SummaryConstructorsConstructorDescriptionCreate a new interval.DayToSecond(int days) Create a new day interval.DayToSecond(int days, int hours) Create a new day-hour interval.DayToSecond(int days, int hours, int minutes) Create a new day-minute interval.DayToSecond(int days, int hours, int minutes, int seconds) Create a new day-second interval.DayToSecond(int days, int hours, int minutes, int seconds, int nano) Create a new day-nanoseconds interval.
- 
Method SummaryModifier and TypeMethodDescriptionfinal DayToSecondabs()Get the absolute value of the interval (set its sign to positive)final intcompareTo(DayToSecond that) static DayToSecondParse a string representation of aINTERVAL DAY TO HOUR.static DayToSecondParse a string representation of aINTERVAL DAY TO HOUR.static DayToSeconddayToMinute(String string) Parse a string representation of aINTERVAL DAY TO MINUTE.static DayToSeconddayToSecond(String string) Parse a string representation of aINTERVAL DAY TO SECOND.final doublefinal booleanfinal floatfinal intgetDays()Get the day-part of this intervalfinal intgetHours()Get the hour-part of this intervalfinal intgetMicro()Get the (truncated) micro-part of this intervalfinal intgetMilli()Get the (truncated) milli-part of this intervalfinal intGet the minute-part of this intervalfinal intgetNano()Get the nano-part of this intervalfinal intGet the second-part of this intervalfinal intgetSign()The sign of the intervalfinal doubleGet the whole interval in daysfinal doubleGet the whole interval in hoursfinal doubleGet the whole interval in micro-secondsfinal doubleGet the whole interval in milli-secondsfinal doubleGet the whole interval in minutesfinal doubleGet the whole interval in nano-secondsfinal doubleGet the whole interval in secondsfinal inthashCode()static DayToSecondParse a string representation of aINTERVAL HOUR.static DayToSecondhourToMinute(String string) Parse a string representation of aINTERVAL HOUR TO MINUTE.static DayToSecondhourToSecond(String string) Parse a string representation of aINTERVAL HOUR TO SECOND.final intintValue()final longstatic DayToSecondParse a string representation of aINTERVAL MINUTE.static DayToSecondminuteToSecond(String string) Parse a string representation of aINTERVAL MINUTE TO SECOND.final DayToSecondneg()Negate the interval (change its sign)static DayToSecondParse a string representation of aINTERVAL SECOND.final DurationGet a duration representation of this interval.final StringtoString()static DayToSecondvalueOf(double milli) Load aDoublerepresentation of aINTERVAL DAY TO SECONDby assuming standard 24 hour days and 60 second minutes.static DayToSecondvalueOf(long second, int nanos) Load aDoublerepresentation of aINTERVAL DAY TO SECONDby assuming standard 24 hour days and 60 second minutes.static DayToSecondParse a string representation of aINTERVAL DAY TO SECOND.static DayToSecondTransform aDurationinto aDayToSecondinterval by taking its number of milliseconds.Methods inherited from class java.lang.NumberbyteValue, shortValueMethods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.jooq.types.IntervalbyteValue, shortValue
- 
Constructor Details- 
DayToSecondpublic DayToSecond()Create a new interval.
- 
DayToSecondpublic DayToSecond(int days) Create a new day interval.
- 
DayToSecondpublic DayToSecond(int days, int hours) Create a new day-hour interval.
- 
DayToSecondpublic DayToSecond(int days, int hours, int minutes) Create a new day-minute interval.
- 
DayToSecondpublic DayToSecond(int days, int hours, int minutes, int seconds) Create a new day-second interval.
- 
DayToSecondpublic DayToSecond(int days, int hours, int minutes, int seconds, int nano) Create a new day-nanoseconds interval.
 
- 
- 
Method Details- 
valueOfParse a string representation of aINTERVAL DAY TO SECOND.- Parameters:
- string- A string representation of the form- [+|-][days] [hours]:[minutes]:[seconds].[fractional seconds]
- Returns:
- The parsed INTERVAL DAY TO SECONDobject, ornullif the string could not be parsed.
 
- 
dayParse a string representation of aINTERVAL DAY TO HOUR.- Parameters:
- string- A string representation of the form- [+|-][days]
- Returns:
- The parsed INTERVAL DAYobject, ornullif the string could not be parsed.
 
- 
dayToHourParse a string representation of aINTERVAL DAY TO HOUR.- Parameters:
- string- A string representation of the form- [+|-][days] [hours]
- Returns:
- The parsed INTERVAL DAY TO HOURobject, ornullif the string could not be parsed.
 
- 
dayToMinuteParse a string representation of aINTERVAL DAY TO MINUTE.- Parameters:
- string- A string representation of the form- [+|-][days] [hours]:[minutes]
- Returns:
- The parsed INTERVAL DAY TO MINUTEobject, ornullif the string could not be parsed.
 
- 
dayToSecondParse a string representation of aINTERVAL DAY TO SECOND.- Parameters:
- string- A string representation of the form- [+|-][days] [hours]:[minutes]:[seconds].[fractional seconds]
- Returns:
- The parsed INTERVAL DAY TO MINUTEobject, ornullif the string could not be parsed.
 
- 
hourParse a string representation of aINTERVAL HOUR.- Parameters:
- string- A string representation of the form- [+|-][hours]
- Returns:
- The parsed INTERVAL HOURobject, ornullif the string could not be parsed.
 
- 
hourToMinuteParse a string representation of aINTERVAL HOUR TO MINUTE.- Parameters:
- string- A string representation of the form- [+|-][hours]:[minutes]
- Returns:
- The parsed INTERVAL HOUR TO MINUTEobject, ornullif the string could not be parsed.
 
- 
hourToSecondParse a string representation of aINTERVAL HOUR TO SECOND.- Parameters:
- string- A string representation of the form- [+|-][hours]:[minutes]:[seconds].[fractional seconds]
- Returns:
- The parsed INTERVAL HOUR TO SECONDobject, ornullif the string could not be parsed.
 
- 
minuteParse a string representation of aINTERVAL MINUTE.- Parameters:
- string- A string representation of the form- [+|-][minutes]
- Returns:
- The parsed INTERVAL MINUTEobject, ornullif the string could not be parsed.
 
- 
minuteToSecondParse a string representation of aINTERVAL MINUTE TO SECOND.- Parameters:
- string- A string representation of the form- [+|-][[minutes]:[seconds].[fractional seconds]
- Returns:
- The parsed INTERVAL MINUTE TO SECONDobject, ornullif the string could not be parsed.
 
- 
secondParse a string representation of aINTERVAL SECOND.- Parameters:
- string- A string representation of the form- [+|-][seconds].[fractional seconds]
- Returns:
- The parsed INTERVAL SECONDobject, ornullif the string could not be parsed.
 
- 
valueOfLoad aDoublerepresentation of aINTERVAL DAY TO SECONDby assuming standard 24 hour days and 60 second minutes.- Parameters:
- milli- The number of milliseconds as a fractional number
- Returns:
- The loaded INTERVAL DAY TO SECONDobject
 
- 
valueOfLoad aDoublerepresentation of aINTERVAL DAY TO SECONDby assuming standard 24 hour days and 60 second minutes.- Parameters:
- second- The number of seconds
- nanos- The number of nano seconds
- Returns:
- The loaded INTERVAL DAY TO SECONDobject
 
- 
valueOfTransform aDurationinto aDayToSecondinterval by taking its number of milliseconds.
- 
toDurationDescription copied from interface:IntervalGet a duration representation of this interval.There is an obvious Durationrepresentation forDayToSecondintervals. If the interval containsYearMonthinformation, then the corresponding duration will use:- 1 year = 365.25 days
- 1 month = 30 days
 This corresponds to PostgreSQL's EXTRACT(EPOCH FROM my_interval)behaviour.- Specified by:
- toDurationin interface- Interval
 
- 
intValuepublic final int intValue()
- 
longValuepublic final long longValue()
- 
floatValuepublic final float floatValue()- Specified by:
- floatValuein interface- Interval
- Specified by:
- floatValuein class- Number
- See Also:
 
- 
doubleValuepublic final double doubleValue()- Specified by:
- doubleValuein interface- Interval
- Specified by:
- doubleValuein class- Number
- See Also:
 
- 
negDescription copied from interface:IntervalNegate the interval (change its sign)
- 
absDescription copied from interface:IntervalGet the absolute value of the interval (set its sign to positive)
- 
getDayspublic final int getDays()Get the day-part of this interval
- 
getHourspublic final int getHours()Get the hour-part of this interval
- 
getMinutespublic final int getMinutes()Get the minute-part of this interval
- 
getSecondspublic final int getSeconds()Get the second-part of this interval
- 
getMillipublic final int getMilli()Get the (truncated) milli-part of this interval
- 
getMicropublic final int getMicro()Get the (truncated) micro-part of this interval
- 
getNanopublic final int getNano()Get the nano-part of this interval
- 
getTotalDayspublic final double getTotalDays()Get the whole interval in days
- 
getTotalHourspublic final double getTotalHours()Get the whole interval in hours
- 
getTotalMinutespublic final double getTotalMinutes()Get the whole interval in minutes
- 
getTotalSecondspublic final double getTotalSeconds()Get the whole interval in seconds
- 
getTotalMillipublic final double getTotalMilli()Get the whole interval in milli-seconds
- 
getTotalMicropublic final double getTotalMicro()Get the whole interval in micro-seconds
- 
getTotalNanopublic final double getTotalNano()Get the whole interval in nano-seconds
- 
getSignpublic final int getSign()Description copied from interface:IntervalThe sign of the interval
- 
compareTo- Specified by:
- compareToin interface- Comparable<DayToSecond>
 
- 
hashCodepublic final int hashCode()
- 
equals
- 
toString
 
-