Enum Class BadiCalendar.Unit
- All Implemented Interfaces:
Serializable,Comparable<BadiCalendar.Unit>,java.lang.constant.Constable,ChronoUnit
- Enclosing class:
- BadiCalendar
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 ConstantsEnum ConstantDescriptionThe 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 TypeMethodDescriptionlongbetween(BadiCalendar start, BadiCalendar end)Calculates the difference between given calendar dates in this unit.doubleDefines the typical length of this time unit in seconds without taking into account anomalies like timezone effects or leap seconds.booleanQueries if this time unit is calendrical respective is at least as long as a calendar day.static BadiCalendar.UnitReturns the enum constant of this class with the specified name.static BadiCalendar.Unit[]values()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
-
Enum Constant Details
-
VAHID_CYCLES
Cycles which last each 19 years.
-
YEARS
Years are defined as vernal equinox years and not as tropical years.
-
MONTHS
The month arithmetic handles the intercalary days (Ayyam-i-Ha) as extension of eighteenth month.
-
WEEKS
Weeks consist of seven days.
-
DAYS
The universal day unit.
-
-
Method Details
-
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
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 nameNullPointerException- if the argument is null
-
getLength
public double getLength()Description copied from interface:ChronoUnitDefines 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:
getLengthin interfaceChronoUnit- Returns:
- estimated decimal value in seconds
-
isCalendrical
public boolean isCalendrical()Description copied from interface:ChronoUnitQueries 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) >= 0is equivalent tounit.isCalendrical().- Specified by:
isCalendricalin interfaceChronoUnit- Returns:
trueif at least as long as a day elsefalse
-
between
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
-