java.lang.Object
java.lang.Enum<TimeUnit>
org.rrd4j.graph.TimeUnit
All Implemented Interfaces:
Serializable, Comparable<TimeUnit>, java.lang.constant.Constable

public enum TimeUnitextends Enum<TimeUnit>
Enumeration of time units used in RRD graphs. Provides mapping between calendar constants and time unit labels for axis formatting.
  • Enum Constant Details

    • SECOND

      public static final TimeUnit SECOND
      Second time unit with second-level label
    • MINUTE

      public static final TimeUnit MINUTE
      Minute time unit with minute-level label
    • HOUR

      public static final TimeUnit HOUR
      Hour time unit with hour-level label
    • DAY

      public static final TimeUnit DAY
      Day time unit with day-level label
    • WEEK

      public static final TimeUnit WEEK
      Week time unit with week-level label
    • MONTH

      public static final TimeUnit MONTH
      Month time unit with month-level label
    • YEAR

      public static final TimeUnit YEAR
      Year time unit with year-level label
  • Constructor Details

    • TimeUnit

      private TimeUnit()
  • Method Details

    • values

      public static TimeUnit[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static TimeUnit valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getLabel

      public abstract String getLabel()
      Get the label format pattern for this time unit.
      Returns:
      the date format pattern for this unit's axis labels
    • resolveUnit

      public static TimeUnit resolveUnit(int unitKey)
      Map a Calendar field constant to the matching time unit.
      Parameters:
      unitKey - Calendar constant (SECOND, MINUTE, HOUR, DAY, WEEK, MONTH, YEAR)
      Returns:
      matching TimeUnit enum value