Class TimestampTokenConverter

    • Constructor Summary

      Constructors 
      Constructor Description
      TimestampTokenConverter()
      Deprecated.
      Constructs a new converter.
      TimestampTokenConverter​(long epochSecs, int subsecNanos, int offsetSecs)
      Deprecated.
      Constructs a converter initialized with the specified epoch time.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method 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​(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 set​(Date d, 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.
    • Constructor Detail

      • TimestampTokenConverter

        public TimestampTokenConverter()
        Deprecated.
        Constructs a new converter. The timestamp value is initialized to the start of epoch.
      • TimestampTokenConverter

        public TimestampTokenConverter​(long epochSecs,
                                       int subsecNanos,
                                       int offsetSecs)
        Deprecated.
        Constructs a converter initialized with the specified epoch time. Epoch time is expressed as time elapsed since January 1, 1970 00:00:00 GMT.
        Parameters:
        epochSecs - number of seconds since Java epoch
        subsecNanos - fractional portion of epoch time in nanoseconds
        offsetSecs - time zone + daylight saving time offset in seconds
    • Method Detail

      • isNull

        public boolean isNull()
        Deprecated.
        Description copied from interface: TokenValued
        Indicates whether the token is null valued. Tokens support null values analogous to SQL. Before accessing the value of the container, it is usually best to ensure it is not null valued using this method.
        Specified by:
        isNull in interface TokenValued
        Returns:
        true if the token is null valued, false otherwise
      • asEpochSecs

        public long asEpochSecs()
        Deprecated.
        Description copied from interface: TimestampValued
        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.
        Specified by:
        asEpochSecs in interface TimestampValued
        Returns:
        the contained value as days since Java epoch. If null valued, as indicated by TokenValued.isNull(), 0 is returned.
        See Also:
        TimestampValued.subsecNanos()
      • subsecNanos

        public int subsecNanos()
        Deprecated.
        Description copied from interface: TimestampValued
        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.
        Specified by:
        subsecNanos in interface TimestampValued
        Returns:
        the subsecond portion of the contained value, in nanoseconds. If null valued, as indicated by TokenValued.isNull(), 0 is returned.
        See Also:
        TimestampValued.asEpochSecs()
      • offsetSecs

        public int offsetSecs()
        Deprecated.
        Description copied from interface: TimestampValued
        Gets the time zone and daylight saving time offset of the contained timestamp value, in seconds.
        Specified by:
        offsetSecs in interface TimestampValued
        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:
        TimestampValued.asEpochSecs()
      • isZero

        public boolean isZero()
        Deprecated.
        Description copied from interface: ScalarValued
        Indicates whether the value is the zero value for the type. Zero values are not stored in sparse representation formats.
        Specified by:
        isZero in interface ScalarValued
        Returns:
        true if the value is the zero value, false otherwise.
      • asString

        public String asString()
        Deprecated.
        Gets a string representation of the current timestamp value.
        Returns:
        an ISO 8601 timestamp string
      • setEpochTime

        public void setEpochTime​(long epochSecs,
                                 int subsecNanos,
                                 int offsetSecs)
        Deprecated.
        Sets the current value to the specified epoch time. Epoch time is expressed as time elapsed since January 1, 1970 00:00:00 GMT.
        Parameters:
        epochSecs - number of seconds since Java epoch
        subsecNanos - fractional portion of epoch time in nanoseconds
        offsetSecs - time zone + daylight saving time offset in seconds
      • set

        public void set​(Date d,
                        TimeZone tz)
        Deprecated.
        Sets the current value to the specified timestamp in the given time zone.
        Parameters:
        d - the timestamp value
        tz - the time zone in which the timestamp applies
      • set

        public void set​(Timestamp ts,
                        TimeZone tz)
        Deprecated.
        Sets the current value to the specified timestamp in the given time zone.
        Parameters:
        ts - the timestamp value
        tz - the time zone in which the timestamp applies
      • set

        public void set​(String value)
        Deprecated.
        Sets the current value to the specified timestamp. The timestamp must be a string in ISO 8601 format.

        For repeated parsing of strings, reuse of a TimestapTokenConverter is more efficient than TimestampDataUtil.parse(String).

        Parameters:
        value - an ISO 8601 timestamp value
      • setTime

        public void setTime​(String time)
        Deprecated.
        Sets the current value to the specified time-of-day, with the date being today's date. The time must be a string in ISO 8601 format.

        For repeated parsing of strings, reuse of a TimestapTokenConverter is more efficient than TimestampDataUtil.parse(String).

        Parameters:
        time - an ISO 8601 time value
      • asTimestamp

        public Timestamp asTimestamp()
        Deprecated.
        Description copied from interface: TimestampValued
        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.
        Specified by:
        asTimestamp in interface TimestampValued
        Returns:
        the contained value as a java.sql.Timestamp. If null valued, as indicated by TokenValued.isNull(), null is returned.