Package org.h2.util

Class TimeZoneProvider.Simple

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String id  
      private int offset  
    • Constructor Summary

      Constructors 
      Constructor Description
      Simple​(int offset)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      long getEpochSecondsFromLocal​(long dateValue, long timeNanos)
      Calculates the epoch seconds from local date and time.
      java.lang.String getId()
      Returns the ID of the time zone.
      java.lang.String getShortId​(long epochSeconds)
      Get the standard time name or daylight saving time name of the time zone.
      int getTimeZoneOffsetLocal​(long dateValue, long timeNanos)
      Calculates the time zone offset in seconds for the specified date value and nanoseconds since midnight in local time.
      int getTimeZoneOffsetUTC​(long epochSeconds)
      Calculates the time zone offset in seconds for the specified EPOCH seconds.
      boolean hasFixedOffset()
      Returns whether this is a simple time zone provider with a fixed offset from UTC.
      int hashCode()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • offset

        private final int offset
      • id

        private volatile java.lang.String id
    • Constructor Detail

      • Simple

        Simple​(int offset)
    • Method Detail

      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • getTimeZoneOffsetUTC

        public int getTimeZoneOffsetUTC​(long epochSeconds)
        Description copied from class: TimeZoneProvider
        Calculates the time zone offset in seconds for the specified EPOCH seconds.
        Specified by:
        getTimeZoneOffsetUTC in class TimeZoneProvider
        Parameters:
        epochSeconds - seconds since EPOCH
        Returns:
        time zone offset in minutes
      • getTimeZoneOffsetLocal

        public int getTimeZoneOffsetLocal​(long dateValue,
                                          long timeNanos)
        Description copied from class: TimeZoneProvider
        Calculates the time zone offset in seconds for the specified date value and nanoseconds since midnight in local time.
        Specified by:
        getTimeZoneOffsetLocal in class TimeZoneProvider
        Parameters:
        dateValue - date value
        timeNanos - nanoseconds since midnight
        Returns:
        time zone offset in minutes
      • getEpochSecondsFromLocal

        public long getEpochSecondsFromLocal​(long dateValue,
                                             long timeNanos)
        Description copied from class: TimeZoneProvider
        Calculates the epoch seconds from local date and time.
        Specified by:
        getEpochSecondsFromLocal in class TimeZoneProvider
        Parameters:
        dateValue - date value
        timeNanos - nanoseconds since midnight
        Returns:
        the epoch seconds value
      • getId

        public java.lang.String getId()
        Description copied from class: TimeZoneProvider
        Returns the ID of the time zone.
        Specified by:
        getId in class TimeZoneProvider
        Returns:
        the ID of the time zone
      • getShortId

        public java.lang.String getShortId​(long epochSeconds)
        Description copied from class: TimeZoneProvider
        Get the standard time name or daylight saving time name of the time zone.
        Specified by:
        getShortId in class TimeZoneProvider
        Parameters:
        epochSeconds - seconds since EPOCH
        Returns:
        the standard time name or daylight saving time name of the time zone
      • hasFixedOffset

        public boolean hasFixedOffset()
        Description copied from class: TimeZoneProvider
        Returns whether this is a simple time zone provider with a fixed offset from UTC.
        Overrides:
        hasFixedOffset in class TimeZoneProvider
        Returns:
        whether this is a simple time zone provider with a fixed offset from UTC
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object