Enum TimeUnit

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private TimeUnit​(boolean yearMonth, char separator, java.math.BigDecimal multiplier, java.math.BigDecimal limit)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static TimeUnit getValue​(int ordinal)
      Returns the TimeUnit associated with an ordinal.
      boolean isValidValue​(java.math.BigDecimal field)
      Returns whether a given value is valid for a field of this time unit.
      static TimeUnit valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static TimeUnit[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • YEAR

        public static final TimeUnit YEAR
      • MONTH

        public static final TimeUnit MONTH
      • HOUR

        public static final TimeUnit HOUR
      • MINUTE

        public static final TimeUnit MINUTE
      • SECOND

        public static final TimeUnit SECOND
      • QUARTER

        public static final TimeUnit QUARTER
      • ISOYEAR

        public static final TimeUnit ISOYEAR
      • WEEK

        public static final TimeUnit WEEK
      • MILLISECOND

        public static final TimeUnit MILLISECOND
      • MICROSECOND

        public static final TimeUnit MICROSECOND
      • NANOSECOND

        public static final TimeUnit NANOSECOND
      • ISODOW

        public static final TimeUnit ISODOW
      • EPOCH

        public static final TimeUnit EPOCH
      • DECADE

        public static final TimeUnit DECADE
      • CENTURY

        public static final TimeUnit CENTURY
      • MILLENNIUM

        public static final TimeUnit MILLENNIUM
    • Field Detail

      • yearMonth

        public final boolean yearMonth
      • separator

        public final char separator
      • multiplier

        public final java.math.BigDecimal multiplier
      • limit

        private final java.math.BigDecimal limit
      • CACHED_VALUES

        private static final TimeUnit[] CACHED_VALUES
    • Constructor Detail

      • TimeUnit

        private TimeUnit​(boolean yearMonth,
                         char separator,
                         java.math.BigDecimal multiplier,
                         java.math.BigDecimal limit)
    • Method Detail

      • values

        public static TimeUnit[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (TimeUnit c : TimeUnit.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static TimeUnit valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • getValue

        public static TimeUnit getValue​(int ordinal)
        Returns the TimeUnit associated with an ordinal. The value returned is null if the ordinal is not a member of the TimeUnit enumeration.
      • isValidValue

        public boolean isValidValue​(java.math.BigDecimal field)
        Returns whether a given value is valid for a field of this time unit.
        Parameters:
        field - Field value
        Returns:
        Whether value