|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.lang.Number
org.jooq.types.YearToMonth
public final class YearToMonth
An implementation for the SQL standard INTERVAL YEAR TO MONTH
data type.
YearToMonth
is a Number
whose Number.intValue()
represents the number of months 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 FormConstructor Summary | |
---|---|
YearToMonth(int years)
Create a new year-month interval. |
|
YearToMonth(int years,
int months)
Create a new year-month interval. |
Method Summary | |
---|---|
YearToMonth |
abs()
Get the absolute value of the interval (set its sign to positive) |
int |
compareTo(YearToMonth that)
|
double |
doubleValue()
|
boolean |
equals(Object obj)
|
float |
floatValue()
|
int |
getMonths()
|
int |
getSign()
The sign of the interval |
int |
getYears()
|
int |
hashCode()
|
int |
intValue()
|
long |
longValue()
|
YearToMonth |
neg()
Negate the interval (change its sign) |
String |
toString()
|
static YearToMonth |
valueOf(String string)
Parse a string representation of a INTERVAL YEAR TO MONTH |
Methods inherited from class java.lang.Number |
---|
byteValue, shortValue |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.jooq.types.Interval |
---|
byteValue, shortValue |
Constructor Detail |
---|
public YearToMonth(int years)
public YearToMonth(int years, int months)
Method Detail |
---|
public static YearToMonth valueOf(String string)
INTERVAL YEAR TO MONTH
string
- A string representation of the form
[+|-][years]-[months]
YEAR TO MONTH
object, or
null
if the string could not be parsed.public final YearToMonth neg()
Interval
neg
in interface Interval
public final YearToMonth abs()
Interval
abs
in interface Interval
public final int getYears()
public final int getMonths()
public final int getSign()
Interval
getSign
in interface Interval
1
for positive or zero, -1
for negativepublic final int intValue()
intValue
in interface Interval
intValue
in class Number
Number.intValue()
public final long longValue()
longValue
in interface Interval
longValue
in class Number
Number.longValue()
public final float floatValue()
floatValue
in interface Interval
floatValue
in class Number
Number.floatValue()
public final double doubleValue()
doubleValue
in interface Interval
doubleValue
in class Number
Number.doubleValue()
public final int compareTo(YearToMonth that)
compareTo
in interface Comparable<YearToMonth>
public final int hashCode()
hashCode
in class Object
public final boolean equals(Object obj)
equals
in class Object
public final String toString()
toString
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |