Class TimeUnit


  • public class TimeUnit
    extends Unit
    Unit implementations representing time intervals measured in seconds.
    Since:
    11 Jan 2018
    Author:
    Mark Taylor
    • Field Detail

      • MICRO

        public static final TimeUnit MICRO
        Microsecond.
      • MILLI

        public static final TimeUnit MILLI
        Millisecond.
      • SECOND

        public static final TimeUnit SECOND
        Second.
      • MINUTE

        public static final TimeUnit MINUTE
        Minute.
      • HOUR

        public static final TimeUnit HOUR
        Hour.
      • DAY

        public static final TimeUnit DAY
        Day (24 hours).
      • WEEK

        public static final TimeUnit WEEK
        Week (7 days).
      • MONTH

        public static final TimeUnit MONTH
        Month (1/12 year).
      • QUARTER

        public static final TimeUnit QUARTER
        Quarter (1/4 year).
      • YEAR

        public static final TimeUnit YEAR
        Year (365.25 days).
    • Constructor Detail

      • TimeUnit

        public TimeUnit​(java.lang.String label,
                        java.lang.String textName,
                        java.lang.String symbol,
                        double extentInSeconds,
                        java.lang.String description)
        Constructor.
        Parameters:
        label - text to appear in a selection interface
        textName - text to appear in user-directed descriptive text
        symbol - text to appear as unit metadata, preferably compatible with the VOUnit standard
        extentInSeconds - extent in units of seconds
        description - descriptive text for XML documentation
    • Method Detail

      • getExtentInSeconds

        public double getExtentInSeconds()
        Returns the extent in seconds.
        Returns:
        unit size in seconds
      • getKnownValues

        public static TimeUnit[] getKnownValues()
        Returns a list of known TimeUnit instances.
        Returns:
        time unit options
      • createHistogramConfigKey

        public static PerUnitConfigKey<Unit> createHistogramConfigKey()
        Returns a new config key for choosing a TimeUnit. It is suitable for use with histogram-like plots in which the horizontal axis represents time.
        Returns:
        time unit config key