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, waitgetType, isZeroisNullpublic void setNull()
TokenSettablesetNull in interface TokenSettablepublic void setZero()
TokenSettablesetZero in interface TokenSettablepublic void set(Date date)
TimestampSettablejava.util.Date object, relative to the default time zone.
The time zone returned by TimeZone.getDefault() is used.set in interface TimestampSettabledate - 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)
TimestampSettablejava.util.Date object, relative to the given time zone.set in interface TimestampSettabledate - 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)
TimestampSettablejava.sql.Timestamp object, relative to the default time zone.
The time zone returned by TimeZone.getDefault() is used.set in interface TimestampSettabletimestamp - 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)
TimestampSettablejava.sql.Timestamp object, relative to the given time zone.set in interface TimestampSettabletimestamp - 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)
TimestampSettableset in interface TimestampSettableseconds - 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)
TokenSettableset in interface TokenSettablevalue - the value to which to set the containerpublic final ScalarTokenType getType()
TokenValuedgetType in interface ScalarValuedgetType in interface TokenValuedgetType in interface ScalarTypedgetType in interface TokenTypedpublic final long asEpochSecs()
TimestampValuedsubsecNanos()
in conjunction with this method.asEpochSecs in interface TimestampValuedTokenValued.isNull(),
0 is returned.TimestampValued.subsecNanos()public final int subsecNanos()
TimestampValuedasEpochSecs(). Thus the value asEpochSecs()
* 1000000000 + subsecNanos() represents the number of
nanoseconds since Java epoch.subsecNanos in interface TimestampValuedTokenValued.isNull(),
0 is returned.TimestampValued.asEpochSecs()public final int offsetSecs()
TimestampValuedoffsetSecs in interface TimestampValuedTokenValued.isNull(), 0 is returned.TimestampValued.asEpochSecs()public final Timestamp asTimestamp()
TimestampValuedjava.sql.Timestamp
relative to the default time zone. The time zone used by
TimeZone#getDefault() is used.asTimestamp in interface TimestampValuedjava.sql.Timestamp.
If null valued, as indicated by TokenValued.isNull(),
null is returned.protected com.pervasive.datarush.tokens.scalar.TimestampParser getParser()
public boolean isZero()
ScalarValuedisZero in interface ScalarValuedtrue if the value is the zero value,
false otherwise.public final boolean isNull()
TokenValuedisNull in interface TokenValuedtrue if the token is null valued,
false otherwiseCopyright © 2024 Actian Corporation. All rights reserved.