public final class DayToSecond extends java.lang.Number implements Interval, java.lang.Comparable<DayToSecond>
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:
Interval,
Serialized Form| Constructor and Description |
|---|
DayToSecond(int days)
Create a new day-hour interval.
|
DayToSecond(int days,
int hours)
Create a new day-hour interval.
|
DayToSecond(int days,
int hours,
int minutes)
Create a new day-hour interval.
|
DayToSecond(int days,
int hours,
int minutes,
int seconds)
Create a new day-hour interval.
|
DayToSecond(int days,
int hours,
int minutes,
int seconds,
int nano)
Create a new day-hour interval.
|
| Modifier and Type | Method and Description |
|---|---|
DayToSecond |
abs()
Get the absolute value of the interval (set its sign to positive)
|
int |
compareTo(DayToSecond that) |
double |
doubleValue() |
boolean |
equals(java.lang.Object obj) |
float |
floatValue() |
int |
getDays()
Get the day-part of this interval
|
int |
getHours()
Get the hour-part of this interval
|
int |
getMicro()
Get the (truncated) micro-part of this interval
|
int |
getMilli()
Get the (truncated) milli-part of this interval
|
int |
getMinutes()
Get the minute-part of this interval
|
int |
getNano()
Get the nano-part of this interval
|
int |
getSeconds()
Get the second-part of this interval
|
int |
getSign()
The sign of the interval
|
double |
getTotalDays()
Get the whole interval in days
|
double |
getTotalHours()
Get the whole interval in hours
|
double |
getTotalMicro()
Get the whole interval in micro-seconds
|
double |
getTotalMilli()
Get the whole interval in milli-seconds
|
double |
getTotalMinutes()
Get the whole interval in minutes
|
double |
getTotalNano()
Get the whole interval in nano-seconds
|
double |
getTotalSeconds()
Get the whole interval in seconds
|
int |
hashCode() |
int |
intValue() |
long |
longValue() |
DayToSecond |
neg()
Negate the interval (change its sign)
|
java.lang.String |
toString() |
static DayToSecond |
valueOf(double milli)
Load a
Double representation of a INTERVAL DAY TO SECOND |
static DayToSecond |
valueOf(java.lang.String string)
Parse a string representation of a
INTERVAL DAY TO SECOND |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitbyteValue, shortValuepublic DayToSecond(int days)
public DayToSecond(int days,
int hours)
public DayToSecond(int days,
int hours,
int minutes)
public DayToSecond(int days,
int hours,
int minutes,
int seconds)
public DayToSecond(int days,
int hours,
int minutes,
int seconds,
int nano)
public static DayToSecond valueOf(java.lang.String string)
INTERVAL DAY TO SECONDstring - A string representation of the form
[+|-][days] [hours]:[minutes]:[seconds].[fractional seconds]INTERVAL DAY TO SECOND object, or
null if the string could not be parsed.public static DayToSecond valueOf(double milli)
Double representation of a INTERVAL DAY TO SECONDmilli - The number of milliseconds as a fractional numberINTERVAL DAY TO SECOND objectpublic final int intValue()
public final long longValue()
public final float floatValue()
floatValue in interface IntervalfloatValue in class java.lang.NumberNumber.floatValue()public final double doubleValue()
doubleValue in interface IntervaldoubleValue in class java.lang.NumberNumber.doubleValue()public final DayToSecond neg()
Intervalpublic final DayToSecond abs()
Intervalpublic final int getDays()
public final int getHours()
public final int getMinutes()
public final int getSeconds()
public final int getMilli()
public final int getMicro()
public final int getNano()
public final double getTotalDays()
public final double getTotalHours()
public final double getTotalMinutes()
public final double getTotalSeconds()
public final double getTotalMilli()
public final double getTotalMicro()
public final double getTotalNano()
public final int getSign()
Intervalpublic final int compareTo(DayToSecond that)
compareTo in interface java.lang.Comparable<DayToSecond>public final int hashCode()
hashCode in class java.lang.Objectpublic final boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic final java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2015. All Rights Reserved.