public static enum BadiCalendar.Unit extends Enum<BadiCalendar.Unit> implements ChronoUnit
Defines come calendar units for the Badi calendar.
| Enum Constant and Description |
|---|
DAYS
The universal day unit.
|
MONTHS
The month arithmetic handles the intercalary days (Ayyam-i-Ha) as extension of eighteenth month.
|
VAHID_CYCLES
Cycles which last each 19 years.
|
WEEKS
Weeks consist of seven days.
|
YEARS
Years are defined as vernal equinox years and not as tropical years.
|
| Modifier and Type | Method and Description |
|---|---|
long |
between(BadiCalendar start,
BadiCalendar end)
Calculates the difference between given calendar dates in this unit.
|
double |
getLength()
Defines the typical length of this time unit in seconds without
taking into account anomalies like timezone effects or leap seconds.
|
boolean |
isCalendrical()
Queries if this time unit is calendrical respective is at least
as long as a calendar day.
|
static BadiCalendar.Unit |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static BadiCalendar.Unit[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final BadiCalendar.Unit VAHID_CYCLES
Cycles which last each 19 years.
public static final BadiCalendar.Unit YEARS
Years are defined as vernal equinox years and not as tropical years.
public static final BadiCalendar.Unit MONTHS
The month arithmetic handles the intercalary days (Ayyam-i-Ha) as extension of eighteenth month.
public static final BadiCalendar.Unit WEEKS
Weeks consist of seven days.
public static final BadiCalendar.Unit DAYS
The universal day unit.
public static BadiCalendar.Unit[] values()
for (BadiCalendar.Unit c : BadiCalendar.Unit.values()) System.out.println(c);
public static BadiCalendar.Unit valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic double getLength()
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.
getLength in interface ChronoUnitpublic boolean isCalendrical()
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) >= 0 is
equivalent to unit.isCalendrical().
isCalendrical in interface ChronoUnittrue if at least as long as a day else falsepublic long between(BadiCalendar start, BadiCalendar end)
Calculates the difference between given calendar dates in this unit.
start - start date (inclusive)end - end date (exclusive)Copyright © 2014–2021. All rights reserved.