Class DateTokenConverter

    • Constructor Summary

      Constructors 
      Constructor Description
      DateTokenConverter()
      Deprecated.
      Constructs a new converter.
      DateTokenConverter​(long epochDays)
      Deprecated.
      Constructs a converter initialized with the specified date.
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      CalendarDate asCalendarDate()
      Deprecated.
      Gets the contained date value.
      Date asDate()
      Deprecated.
      Gets the contained date value as a java.sql.Date relative to the default time zone.
      Date asDate​(TimeZone tz)
      Deprecated.
      Gets the contained date value as a java.sql.Date relative to the given time zone.
      long asEpochDays()
      Deprecated.
      Gets the contained date value as the number of days since Java epoch (January 1, 1970).
      String asString()
      Deprecated.
      Gets a string representation of the current date value.
      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.
      void set​(TimestampValued token)
      Deprecated.
      Sets the current date value to the date portion of the specified timestamp value.
      void set​(String timestamp)
      Deprecated.
      Sets the current date value to the date portion of the specified timestamp.
      void set​(Date date, TimeZone tz)
      Deprecated.
      Sets the current date value to the date portion of the specified Java date in the given time zone.
      void setEpochDays​(long epochDays)
      Deprecated.
      Sets the current date value to the specified date.
    • Constructor Detail

      • DateTokenConverter

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

        public DateTokenConverter​(long epochDays)
        Deprecated.
        Constructs a converter initialized with the specified date.
        Parameters:
        epochDays - the date specified in epoch days.
    • 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
      • asEpochDays

        public long asEpochDays()
        Deprecated.
        Description copied from interface: DateValued
        Gets the contained date value as the number of days since Java epoch (January 1, 1970).
        Specified by:
        asEpochDays in interface DateValued
        Returns:
        the contained value as days since Java epoch. If null valued, as indicated by TokenValued.isNull(), 0 is returned.
      • isZero

        public final 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.
      • setEpochDays

        public void setEpochDays​(long epochDays)
        Deprecated.
        Sets the current date value to the specified date.
        Parameters:
        epochDays - the date specified in epoch days.
      • asDate

        public Date asDate()
        Deprecated.
        Description copied from interface: DateValued
        Gets the contained date value as a java.sql.Date relative to the default time zone. The time zone used by TimeZone.getDefault() is used.
        Specified by:
        asDate in interface DateValued
        Returns:
        the contained value as a java.sql.Date. If null valued, as indicated by TokenValued.isNull(), null is returned.
      • asDate

        public Date asDate​(TimeZone tz)
        Deprecated.
        Description copied from interface: DateValued
        Gets the contained date value as a java.sql.Date relative to the given time zone.
        Specified by:
        asDate in interface DateValued
        Parameters:
        tz - the time zone in which to interpret the date
        Returns:
        the contained value as a java.sql.Date. If null valued, as indicated by TokenValued.isNull(), null is returned.
      • asCalendarDate

        public CalendarDate asCalendarDate()
        Deprecated.
        Description copied from interface: DateValued
        Gets the contained date value. This value represents the timezone free date portion of a timestamp.
        Specified by:
        asCalendarDate in interface DateValued
        Returns:
        the contained value as a calendar date. If null valued, as indicated by TokenValued.isNull(), null is returned.
      • set

        public void set​(TimestampValued token)
        Deprecated.
        Sets the current date value to the date portion of the specified timestamp value.
        Parameters:
        token - the timestamp value to truncate
      • set

        public void set​(Date date,
                        TimeZone tz)
        Deprecated.
        Sets the current date value to the date portion of the specified Java date in the given time zone.
        Parameters:
        date - the timestamp value
        tz - the time zone to which the timestamp is relative
      • asString

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

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

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

        Parameters:
        timestamp - an ISO 8601 timestamp value