public class IntervalDF extends Interval
Timestamp| Modifier and Type | Field and Description |
|---|---|
protected static int |
MilliPerSecond |
protected long |
nanos |
protected static int |
NanosPerSecond |
protected long |
seconds |
protected static int |
SecondsPerDay |
protected static int |
SecondsPerHour |
protected static int |
SecondsPerMinute |
| Constructor and Description |
|---|
IntervalDF()
Default Constructor with the default qualifier set to:
leading field precision: 2
start code: TU_DAY
end code: TU_F5
|
IntervalDF(java.sql.Connection conn)
Default Constructor with the default qualifier set to:
leading field precision: 2
start code: TU_DAY
end code: TU_F5
This constructor allows you to display localized error messages
if an exception is thrown.
|
IntervalDF(long seconds,
long nanos)
Creates an Interval from a number of seconds and nanoseconds.
|
IntervalDF(long seconds,
long nanos,
java.sql.Connection conn)
Creates an Interval from a number of seconds and nanoseconds.
|
IntervalDF(long seconds,
long nanos,
short qual)
Creates an Interval from a number of seconds, number of nanoseconds,
and qualifier.
|
IntervalDF(long seconds,
long nanos,
short qual,
java.sql.Connection conn)
Creates an Interval from a number of seconds, number of nanoseconds,
and qualifier.
|
IntervalDF(java.lang.String str)
Creates an Interval from a string and the default qualifier
is set to:
leading field precision: 2
start code: TU_DAY
end code: TU_F5
|
IntervalDF(java.lang.String str,
byte startCode,
byte endCode)
Creates an Interval from a string and qualifier information.
|
IntervalDF(java.lang.String str,
java.sql.Connection conn)
Creates an Interval from a string and the default qualifier
is set to:
leading field precision: 2
start code: TU_DAY
end code: TU_F5
This constructor supports localized error messages.
|
IntervalDF(java.lang.String str,
int len,
byte startCode,
byte endCode)
Creates an Interval from a string and qualifier information.
|
IntervalDF(java.lang.String str,
int len,
byte startCode,
byte endCode,
java.sql.Connection conn)
Creates an Interval from a string and qualifier information.
|
IntervalDF(java.lang.String str,
short qual)
Creates an Interval from a string and the qualifier.
|
IntervalDF(java.lang.String str,
short qual,
java.sql.Connection conn)
Creates an Interval from a string and the qualifier.
|
IntervalDF(java.sql.Timestamp t1,
java.sql.Timestamp t2)
Creates an Interval object from two timestamps.
|
IntervalDF(java.sql.Timestamp t1,
java.sql.Timestamp t2,
java.sql.Connection conn)
Creates an Interval object from two timestamps.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
void |
fromString(java.lang.String str)
Sets the values for the Interval from a string.
|
long |
getNanoSeconds()
Returns the number of nanoseconds in the Interval.
|
long |
getSeconds()
Returns the number of seconds in the Interval.
|
boolean |
greaterThan(IntervalDF other)
Compares this Interval with another to see if it is
greater (longer in time) than the other.
|
int |
hashCode() |
boolean |
lessThan(IntervalDF other)
Compares this Interval with another to see if it is
less (shorter in time) than the other.
|
void |
set(long seconds,
long nanos)
Sets the value of the Interval from specified second and
nanosecond values.
|
void |
set(java.lang.String str)
Sets the value of the Interval from a specified string.
|
void |
set(java.sql.Timestamp t1,
java.sql.Timestamp t2)
Sets the value of the Interval from the difference
between two timestamps.
|
void |
setQualifier(byte len,
byte startCode,
byte endCode)
Sets the qualifier from its constituent pieces.
|
void |
setQualifier(short qualifier)
Sets the qualifier using an existing qualifier.
|
java.lang.String |
toString()
Creates a string representation of the interval in the following format:
ddddd hh:mm:ss.nano
The presence of the various fields depends upon the qualifier.
|
getEndCode, getEndCode, getFieldName, getFirstLength, getIfxTypeName, getLength, getLength, getQualifier, getQualifier, getQualifier, getScale, getStartCode, getStartCode, getStaticEndCode, getStaticStartCode, goodQualifier, setConnection, stringToUnitsprotected long seconds
protected long nanos
protected static final int NanosPerSecond
protected static final int MilliPerSecond
protected static final int SecondsPerMinute
protected static final int SecondsPerHour
protected static final int SecondsPerDay
public IntervalDF()
public IntervalDF(java.sql.Connection conn)
conn - Connection objectpublic IntervalDF(java.sql.Timestamp t1,
java.sql.Timestamp t2)
t1 - First timestamp.t2 - Second timestamp.public IntervalDF(java.sql.Timestamp t1,
java.sql.Timestamp t2,
java.sql.Connection conn)
t1 - First timestamp.t2 - Second timestamp.conn - Connection object.public IntervalDF(long seconds,
long nanos)
seconds - Number of seconds in the interval.nanos - Number of nanoseconds in the interval.public IntervalDF(long seconds,
long nanos,
java.sql.Connection conn)
seconds - Number of seconds in the interval.nanos - Number of nanoseconds in the interval.conn - Connection objectpublic IntervalDF(long seconds,
long nanos,
short qual)
throws java.sql.SQLException
seconds - Number of seconds in the interval.nanos - Number of nanoseconds in the interval.qual - Interval qualifier value.java.sql.SQLException - if there is a database access errorpublic IntervalDF(long seconds,
long nanos,
short qual,
java.sql.Connection conn)
throws java.sql.SQLException
seconds - Number of seconds in the interval.nanos - Number of nanoseconds in the interval.qual - Interval qualifier value.conn - Connection objectjava.sql.SQLException - if there is a database access errorpublic IntervalDF(java.lang.String str)
throws java.sql.SQLException
str - String Interval value.java.sql.SQLException - if there is a database access errorpublic IntervalDF(java.lang.String str,
java.sql.Connection conn)
throws java.sql.SQLException
str - String Interval value.conn - Connection objectjava.sql.SQLException - if there is a database access errorpublic IntervalDF(java.lang.String str,
short qual)
throws java.sql.SQLException
str - String Interval value.qual - Interval qualifier value.java.sql.SQLException - if there is a database access errorpublic IntervalDF(java.lang.String str,
short qual,
java.sql.Connection conn)
throws java.sql.SQLException
str - String Interval value.qual - Interval qualifier value.conn - Connection objectjava.sql.SQLException - if there is a database access errorpublic IntervalDF(java.lang.String str,
int len,
byte startCode,
byte endCode)
throws java.sql.SQLException
str - The string representation of the day to fraction Interval.len - The total length of the qualifier fields.startCode - The starting time unit value (TU_XXX).endCode - The ending time unit value (TU_XXX).java.sql.SQLException - if there is a database access errorpublic IntervalDF(java.lang.String str,
byte startCode,
byte endCode)
throws java.sql.SQLException
str - The string representation of the day to fraction Interval.startCode - The starting time unit value (TU_XXX).endCode - The ending time unit value (TU_XXX).java.sql.SQLException - if there is a database access errorpublic IntervalDF(java.lang.String str,
int len,
byte startCode,
byte endCode,
java.sql.Connection conn)
throws java.sql.SQLException
str - The string representation of the day to fraction Interval.len - The total length of the qualifier fields.startCode - The starting time unit value (TU_XXX).endCode - The ending time unit value (TU_XXX).conn - Connection objectjava.sql.SQLException - if there is a database access errorpublic void set(java.sql.Timestamp t1,
java.sql.Timestamp t2)
t1 - First timestamp.t2 - Second timestamp.public void set(long seconds,
long nanos)
seconds - Number of seconds in the interval.nanos - Number of nanoseconds in the interval.public void set(java.lang.String str)
throws java.sql.SQLException
str - A valid string representing a day to fraction INTERVAL.java.sql.SQLException - if there is a database access errorpublic java.lang.String toString()
toString in class java.lang.Objectpublic void fromString(java.lang.String str)
throws java.sql.SQLException
str - String in ddddd hh:mm:ss.nano format.java.sql.SQLException - if there is a database access errorpublic long getSeconds()
public long getNanoSeconds()
public boolean greaterThan(IntervalDF other)
other - The Interval to which this Interval is compared.public boolean lessThan(IntervalDF other)
other - The Interval to which this Interval is compared.public void setQualifier(byte len,
byte startCode,
byte endCode)
throws java.sql.SQLException
len - The total length of the qualifier fields.startCode - The starting time unit value (TU_XXX).endCode - The ending time unit value (TU_XXX).java.sql.SQLException - if there is a database access errorpublic void setQualifier(short qualifier)
throws java.sql.SQLException
qualifier - The qualifier value.java.sql.SQLException - if there is a database access error