public final class TimestampRegister extends Object implements ScalarRegister, TimestampSettable
TimestampValued
object.Constructor and Description |
---|
TimestampRegister()
Creates a new null-valued register.
|
Modifier and Type | Method and Description |
---|---|
long |
asEpochSecs()
Gets the contained timestamp value as the number of seconds since
Java epoch (January 1, 1970 00:00:00 GMT).
|
Timestamp |
asTimestamp()
Gets the contained timestamp value as a
java.sql.Timestamp
relative to the default time zone. |
protected com.pervasive.datarush.tokens.scalar.TimestampParser |
getParser()
Get the cached parser used by this object.
|
ScalarTokenType |
getType()
Gets the data type of the token.
|
boolean |
isNull()
Indicates whether the token is null valued.
|
boolean |
isZero()
Indicates whether the value is the zero value
for the type.
|
int |
offsetSecs()
Gets the time zone and daylight saving time offset of the contained
timestamp value, in seconds.
|
void |
set(Date date)
Sets the container to a timestamp value specified as a
java.util.Date object, relative to the default time zone. |
void |
set(Date date,
TimeZone timeZone)
Sets the container to a timestamp value specified as a
java.util.Date object, relative to the given time zone. |
void |
set(long seconds,
int nanos,
int offsetSeconds)
Sets the container to a timestamp value specified as time since
Java epoch (January 1, 1970 00:00:00 GMT) with time zone and daylight
saving time offset.
|
void |
set(Timestamp timestamp)
Sets the container to a timestamp value specified as a
java.sql.Timestamp object, relative to the default time zone. |
void |
set(Timestamp timestamp,
TimeZone timeZone)
Sets the container to a timestamp value specified as a
java.sql.Timestamp object, relative to the given time zone. |
void |
set(TokenValued value)
Sets the contained value to the given token value.
|
void |
setNull()
Sets the contained value to be null valued.
|
void |
setZero()
Sets the contained value to be zero valued.
|
int |
subsecNanos()
Gets the subsecond portion of the contained timestamp value.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getType, isZero
isNull
public void setNull()
TokenSettable
setNull
in interface TokenSettable
public void setZero()
TokenSettable
setZero
in interface TokenSettable
public void set(Date date)
TimestampSettable
java.util.Date
object, relative to the default time zone.
The time zone returned by TimeZone.getDefault()
is used.set
in interface TimestampSettable
date
- timestamp value to which to set the container, expressed
as a point in time relative to the default time zone.public void set(Date date, TimeZone timeZone)
TimestampSettable
java.util.Date
object, relative to the given time zone.set
in interface TimestampSettable
date
- timestamp value to which to set the container, expressed
as a point in time relative to the default time zone.timeZone
- the time zone in which the timestamp should be interpretedpublic void set(Timestamp timestamp)
TimestampSettable
java.sql.Timestamp
object, relative to the default time zone.
The time zone returned by TimeZone.getDefault()
is used.set
in interface TimestampSettable
timestamp
- timestamp value to which to set the container, expressed
as a point in time relative to the default time zone.public void set(Timestamp timestamp, TimeZone timeZone)
TimestampSettable
java.sql.Timestamp
object, relative to the given time zone.set
in interface TimestampSettable
timestamp
- timestamp value to which to set the container, expressed
as a point in time relative to the default time zone.timeZone
- the time zone in which the timestamp should be interpretedpublic void set(long seconds, int nanos, int offsetSeconds)
TimestampSettable
set
in interface TimestampSettable
seconds
- number of seconds since Java epochnanos
- fractional portion of epoch time in nanosecondsoffsetSeconds
- time zone and daylight saving time offset, in secondspublic void set(TokenValued value)
TokenSettable
set
in interface TokenSettable
value
- the value to which to set the containerpublic final ScalarTokenType getType()
TokenValued
getType
in interface ScalarValued
getType
in interface TokenValued
getType
in interface ScalarTyped
getType
in interface TokenTyped
public final long asEpochSecs()
TimestampValued
subsecNanos()
in conjunction with this method.asEpochSecs
in interface TimestampValued
TokenValued.isNull()
,
0
is returned.TimestampValued.subsecNanos()
public final int subsecNanos()
TimestampValued
asEpochSecs()
. Thus the value asEpochSecs()
* 1000000000 + subsecNanos()
represents the number of
nanoseconds since Java epoch.subsecNanos
in interface TimestampValued
TokenValued.isNull()
,
0
is returned.TimestampValued.asEpochSecs()
public final int offsetSecs()
TimestampValued
offsetSecs
in interface TimestampValued
TokenValued.isNull()
, 0
is returned.TimestampValued.asEpochSecs()
public final Timestamp asTimestamp()
TimestampValued
java.sql.Timestamp
relative to the default time zone. The time zone used by
TimeZone#getDefault()
is used.asTimestamp
in interface TimestampValued
java.sql.Timestamp
.
If null valued, as indicated by TokenValued.isNull()
,
null
is returned.protected com.pervasive.datarush.tokens.scalar.TimestampParser getParser()
public boolean isZero()
ScalarValued
isZero
in interface ScalarValued
true
if the value is the zero value,
false
otherwise.public final boolean isNull()
TokenValued
isNull
in interface TokenValued
true
if the token is null valued,
false
otherwiseCopyright © 2019 Actian Corporation. All rights reserved.