Interface TimestampValued

All Superinterfaces:
ScalarTyped, ScalarValued, TokenTyped, TokenValued
All Known Subinterfaces:
TimestampInputField, TimestampValuedIterator
All Known Implementing Classes:
NullToken, TimestampRegister, TimestampToken, TimestampTokenConverter

public interface TimestampValued extends ScalarValued
A TokenValued object containing a timestamp value.
See Also:
  • TokenTypeConstant#TIMESTAMP
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Gets the contained timestamp value as the number of seconds since Java epoch (January 1, 1970 00:00:00 GMT).
    Gets the contained timestamp value as a java.sql.Timestamp relative to the default time zone.
    int
    Gets the time zone and daylight saving time offset of the contained timestamp value, in seconds.
    int
    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 Details

    • asTimestamp

      Timestamp asTimestamp()
      Gets the contained timestamp value as a java.sql.Timestamp relative to the default time zone. The time zone used by TimeZone#getDefault() is used.
      Returns:
      the contained value as a java.sql.Timestamp. If null valued, as indicated by TokenValued.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, use subsecNanos() 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

      int subsecNanos()
      Gets the subsecond portion of the contained timestamp value. The value returned is relative to the seconds value returned by asEpochSecs(). Thus the value asEpochSecs() * 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:
    • 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: