@Deprecated public class TimestampTokenConverter extends Object implements TimestampValued
TimestampToken.
Utilities for some of the same conversions are also available
in TimestampDataUtil. However, if many conversions
are to be performed, it is more efficient to reuse
a TimestampTokenConverter.
| Constructor and Description |
|---|
TimestampTokenConverter()
Deprecated.
Constructs a new converter.
|
TimestampTokenConverter(long epochSecs,
int subsecNanos,
int offsetSecs)
Deprecated.
Constructs a converter initialized with the specified
epoch time.
|
| Modifier and Type | Method and Description |
|---|---|
long |
asEpochSecs()
Deprecated.
Gets the contained timestamp value as the number of seconds since
Java epoch (January 1, 1970 00:00:00 GMT).
|
String |
asString()
Deprecated.
Gets a string representation of the current timestamp value.
|
Timestamp |
asTimestamp()
Deprecated.
Gets the contained timestamp value as a
java.sql.Timestamp
relative to the default time zone. |
ScalarTokenType |
getType()
Deprecated.
Gets the data type of the token.
|
boolean |
isNull()
Deprecated.
Indicates whether the token is null valued.
|
boolean |
isZero()
Deprecated.
Indicates whether the value is the zero value
for the type.
|
int |
offsetSecs()
Deprecated.
Gets the time zone and daylight saving time offset of the contained
timestamp value, in seconds.
|
void |
set(Date d,
TimeZone tz)
Deprecated.
Sets the current value to the specified timestamp in
the given time zone.
|
void |
set(String value)
Deprecated.
Sets the current value to the specified timestamp.
|
void |
set(Timestamp ts,
TimeZone tz)
Deprecated.
Sets the current value to the specified timestamp in
the given time zone.
|
void |
setEpochTime(long epochSecs,
int subsecNanos,
int offsetSecs)
Deprecated.
Sets the current value to the specified epoch time.
|
void |
setTime(String time)
Deprecated.
Sets the current value to the specified time-of-day,
with the date being today's date.
|
int |
subsecNanos()
Deprecated.
Gets the subsecond portion of the contained timestamp value.
|
public TimestampTokenConverter()
public TimestampTokenConverter(long epochSecs,
int subsecNanos,
int offsetSecs)
epochSecs - number of seconds since Java epochsubsecNanos - fractional portion of epoch time in nanosecondsoffsetSecs - time zone + daylight saving time offset in secondspublic ScalarTokenType getType()
TokenValuedgetType in interface ScalarValuedgetType in interface TokenValuedgetType in interface ScalarTypedgetType in interface TokenTypedpublic boolean isNull()
TokenValuedisNull in interface TokenValuedtrue if the token is null valued,
false otherwisepublic long asEpochSecs()
TimestampValuedsubsecNanos()
in conjunction with this method.asEpochSecs in interface TimestampValuedTokenValued.isNull(),
0 is returned.TimestampValued.subsecNanos()public 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 int offsetSecs()
TimestampValuedoffsetSecs in interface TimestampValuedTokenValued.isNull(), 0 is returned.TimestampValued.asEpochSecs()public boolean isZero()
ScalarValuedisZero in interface ScalarValuedtrue if the value is the zero value,
false otherwise.public String asString()
public void setEpochTime(long epochSecs,
int subsecNanos,
int offsetSecs)
epochSecs - number of seconds since Java epochsubsecNanos - fractional portion of epoch time in nanosecondsoffsetSecs - time zone + daylight saving time offset in secondspublic void set(Date d, TimeZone tz)
d - the timestamp valuetz - the time zone in which the timestamp appliespublic void set(Timestamp ts, TimeZone tz)
ts - the timestamp valuetz - the time zone in which the timestamp appliespublic void set(String value)
For repeated parsing of strings, reuse of a
TimestapTokenConverter is more efficient
than TimestampDataUtil.parse(String).
value - an ISO 8601 timestamp valuepublic void setTime(String time)
For repeated parsing of strings, reuse of a
TimestapTokenConverter is more efficient
than TimestampDataUtil.parse(String).
time - an ISO 8601 time valuepublic 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.Copyright © 2020 Actian Corporation. All rights reserved.