Enum Class BadiCalendar.Unit

java.lang.Object
java.lang.Enum<BadiCalendar.Unit>
net.time4j.calendar.bahai.BadiCalendar.Unit
All Implemented Interfaces:
Serializable, Comparable<BadiCalendar.Unit>, java.lang.constant.Constable, ChronoUnit
Enclosing class:
BadiCalendar

public static enum BadiCalendar.Unit extends Enum<BadiCalendar.Unit> implements ChronoUnit

Defines come calendar units for the Badi calendar.

  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    The universal day unit.
    The month arithmetic handles the intercalary days (Ayyam-i-Ha) as extension of eighteenth month.
    Cycles which last each 19 years.
    Weeks consist of seven days.
    Years are defined as vernal equinox years and not as tropical years.
  • Method Summary

    Modifier and Type
    Method
    Description
    long
    Calculates the difference between given calendar dates in this unit.
    double
    Defines the typical length of this time unit in seconds without taking into account anomalies like timezone effects or leap seconds.
    boolean
    Queries if this time unit is calendrical respective is at least as long as a calendar day.
    valueOf​(String name)
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class java.lang.Enum

    compareTo, describeConstable, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf

    Methods inherited from class java.lang.Object

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

    • VAHID_CYCLES

      public static final BadiCalendar.Unit VAHID_CYCLES

      Cycles which last each 19 years.

    • YEARS

      public static final BadiCalendar.Unit YEARS

      Years are defined as vernal equinox years and not as tropical years.

    • MONTHS

      public static final BadiCalendar.Unit MONTHS

      The month arithmetic handles the intercalary days (Ayyam-i-Ha) as extension of eighteenth month.

    • WEEKS

      public static final BadiCalendar.Unit WEEKS

      Weeks consist of seven days.

    • DAYS

      public static final BadiCalendar.Unit DAYS

      The universal day unit.

  • Method Details

    • values

      public static BadiCalendar.Unit[] 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 BadiCalendar.Unit 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
    • getLength

      public double getLength()
      Description copied from interface: ChronoUnit

      Defines the typical length of this time unit in seconds without taking into account anomalies like timezone effects or leap seconds.

      Important note: This method can only yield an estimated value and is not intended to assist in calculations of durations, but only in sorting of units.

      Specified by:
      getLength in interface ChronoUnit
      Returns:
      estimated decimal value in seconds
    • isCalendrical

      public boolean isCalendrical()
      Description copied from interface: ChronoUnit

      Queries if this time unit is calendrical respective is at least as long as a calendar day.

      Implementation note: The method must be consistent with the typical length of the unit. The expression Double.compare(unit.getLength(), 86400.0) >= 0 is equivalent to unit.isCalendrical().

      Specified by:
      isCalendrical in interface ChronoUnit
      Returns:
      true if at least as long as a day else false
    • between

      public long between(BadiCalendar start, BadiCalendar end)

      Calculates the difference between given calendar dates in this unit.

      Parameters:
      start - start date (inclusive)
      end - end date (exclusive)
      Returns:
      difference counted in this unit