-
- All Superinterfaces:
ScalarTyped
,ScalarValued
,TokenTyped
,TokenValued
- All Known Subinterfaces:
TimestampInputField
,TimestampValuedIterator
- All Known Implementing Classes:
NullToken
,TimestampRegister
,TimestampToken
,TimestampTokenConverter
public interface TimestampValued extends ScalarValued
ATokenValued
object containing a timestamp value.- See Also:
TokenTypeConstant#TIMESTAMP
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method 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 ajava.sql.Timestamp
relative to the default time zone.int
offsetSecs()
Gets the time zone and daylight saving time offset of the contained timestamp value, in seconds.int
subsecNanos()
Gets the subsecond portion of the contained timestamp value.-
Methods inherited from interface com.pervasive.datarush.tokens.scalar.ScalarValued
getType, isZero
-
Methods inherited from interface com.pervasive.datarush.tokens.TokenValued
isNull
-
-
-
-
Method Detail
-
asTimestamp
Timestamp asTimestamp()
Gets the contained timestamp value as ajava.sql.Timestamp
relative to the default time zone. The time zone used byTimeZone#getDefault()
is used.- Returns:
- the contained value as a
java.sql.Timestamp
. If null valued, as indicated byTokenValued.isNull()
,null
is returned.
-
asEpochSecs
long asEpochSecs()
Gets the contained timestamp value as the number of seconds since Java epoch (January 1, 1970 00:00:00 GMT). Timestamp values support nanosecond precision, although this method does not expose it. To access this level of detail, usesubsecNanos()
in conjunction with this method.- Returns:
- the contained value as days since Java epoch.
If null valued, as indicated by
TokenValued.isNull()
,0
is returned. - See Also:
subsecNanos()
-
subsecNanos
int subsecNanos()
Gets the subsecond portion of the contained timestamp value. The value returned is relative to the seconds value returned byasEpochSecs()
. Thus the valueasEpochSecs() * 1000000000 + subsecNanos()
represents the number of nanoseconds since Java epoch.- Returns:
- the subsecond portion of the contained value, in
nanoseconds. If null valued, as indicated by
TokenValued.isNull()
,0
is returned. - See Also:
asEpochSecs()
-
offsetSecs
int offsetSecs()
Gets the time zone and daylight saving time offset of the contained timestamp value, in seconds.- Returns:
- the time zone and daylight saving time offset of the
contained value, in seconds. If null valued, as indicated by
TokenValued.isNull()
,0
is returned. - See Also:
asEpochSecs()
-
-