Class TimeUnit

java.lang.Object
uk.ac.starlink.ttools.plot2.layer.Unit
uk.ac.starlink.ttools.plot2.geom.TimeUnit

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

    • 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 Details

    • TimeUnit

      public TimeUnit(String label, String textName, String symbol, double extentInSeconds, 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 Details

    • 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