Enum Class FrenchRepublicanCalendar.Unit

All Implemented Interfaces:
Serializable, Comparable<FrenchRepublicanCalendar.Unit>, java.lang.constant.Constable, ChronoUnit
Enclosing class:

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

Defines come calendar units for the French revolutionary calendar.

  • Enum Constant Details

    • YEARS

      public static final FrenchRepublicanCalendar.Unit YEARS

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

    • MONTHS

      public static final FrenchRepublicanCalendar.Unit MONTHS

      The month arithmetic handles the sansculottides as extension of last month Fructidor.

      The resulting date is always within a republican month. Example:

           FrenchRepublicanCalendar cal = FrenchRepublicanCalendar.of(1, Sansculottides.COMPLEMENTARY_DAY_3);
           FrenchRepublicanCalendar next = cal.plus(1, FrenchRepublicanCalendar.Unit.MONTHS);
           System.out.println(next); // French-Republic-II-01-30 (30th of Vendémiaire II)

      public static final FrenchRepublicanCalendar.Unit DECADES

      Decades consist of ten days where complementary days will be ignored or skipped.

    • WEEKS

      public static final FrenchRepublicanCalendar.Unit WEEKS

      Weeks consist of seven days.

    • DAYS

      public static final FrenchRepublicanCalendar.Unit DAYS

      The universal day unit.

  • Method Details

    • values

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

      public static FrenchRepublicanCalendar.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.)
      name - the name of the enum constant to be returned.
      the enum constant with the specified name
      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
      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
      true if at least as long as a day else false
    • between

      public long between(FrenchRepublicanCalendar start, FrenchRepublicanCalendar end)

      Calculates the difference between given calendar dates in this unit.

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