public final class HinduVariant extends Object implements VariantSource, Serializable
The Hindu calendar variants differ on various sets of calculations, month names and the choice of era.
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
static HinduVariant |
from(String variant)
Parses given variant string.
|
HinduEra |
getDefaultEra()
Obtains the default era.
|
GeoLocation |
getLocation()
Obtains the geographical reference point which is usually the holy city of Ujjain.
|
String |
getVariant()
Yields the variant name of a calendar system.
|
int |
hashCode() |
boolean |
isAmanta()
Determines if this variant describes the amanta scheme.
|
boolean |
isLunisolar()
Determines if this variant describes the lunisolar Hindu calendar.
|
boolean |
isOld()
Determines if this variant describes the old Hindu calendar based on mean astronomical values.
|
boolean |
isPurnimanta()
Determines if this variant describes the purnimanta scheme.
|
boolean |
isSolar()
Determines if this variant describes the solar Hindu calendar.
|
boolean |
isUsingElapsedYears()
Does this variant use elapsed years?
|
String |
toString() |
HinduVariant |
with(HinduEra defaultEra)
Creates a copy of this variant with given preferred era.
|
HinduVariant |
withAlternativeHinduSunrise()
Deprecated.
Use
withModernAstronomy(double) instead |
HinduVariant |
withAlternativeLocation(GeoLocation location)
Creates a copy of this variant with an alternative geographical location.
|
HinduVariant |
withCurrentYears()
Creates a copy of this variant with current years.
|
HinduVariant |
withElapsedYears()
Creates a copy of this variant with elapsed years.
|
HinduVariant |
withModernAstronomy(double depressionAngle)
Creates a copy of this variant based on modern astronomy which also deploys an alternative
internal calculation for the sunrise or sunset.
|
public static HinduVariant from(String variant)
Parses given variant string.
The variant string is the same as created by calling getVariant().
variant - variant stringIllegalArgumentException - if given argument cannot be parsedgetVariant(),
HinduRule.variant(),
AryaSiddhanta.variant()public HinduEra getDefaultEra()
Obtains the default era.
public GeoLocation getLocation()
Obtains the geographical reference point which is usually the holy city of Ujjain.
public boolean isSolar()
Determines if this variant describes the solar Hindu calendar.
public boolean isLunisolar()
Determines if this variant describes the lunisolar Hindu calendar.
Lunisolar variants follow either the amanta or the purnimanta scheme.
isAmanta(),
isPurnimanta()public boolean isAmanta()
Determines if this variant describes the amanta scheme.
Months are synchronized with the New Moon.
public boolean isPurnimanta()
Determines if this variant describes the purnimanta scheme.
Months are synchronized with the Full Moon. The first day of a purnimanta month starts with 16 or higher.
public boolean isOld()
Determines if this variant describes the old Hindu calendar based on mean astronomical values.
public boolean isUsingElapsedYears()
Does this variant use elapsed years?
Elapsed years are the standard, however, in most southern parts of India current years are used, for example Madras, Malayali (Kollam) and Tamil use current years.
withElapsedYears(),
withCurrentYears()public String getVariant()
VariantSourceYields the variant name of a calendar system.
getVariant in interface VariantSourcepublic HinduVariant with(HinduEra defaultEra)
Creates a copy of this variant with given preferred era.
Note: The old Hindu calendar is not customizable.
defaultEra - the new deviating erapublic HinduVariant withElapsedYears()
Creates a copy of this variant with elapsed years.
Note: Elapsed years count one less than current years.
withCurrentYears(),
isUsingElapsedYears()public HinduVariant withCurrentYears()
Creates a copy of this variant with current years.
Note: Elapsed years count one less than current years. The old Hindu calendar is not customizable.
withElapsedYears(),
isUsingElapsedYears()@Deprecated public HinduVariant withAlternativeHinduSunrise()
withModernAstronomy(double) insteadOutdated method without any effect.
public HinduVariant withModernAstronomy(double depressionAngle)
Creates a copy of this variant based on modern astronomy which also deploys an alternative internal calculation for the sunrise or sunset.
Note: The old Hindu calendar is not customizable. Most calendar makers in India use geometric sunrise
without refraction for the modern Hindu calendar, i.e. they use 0.0 as depression angle. Another
author, Lahiri, uses the angle of 47' corresponding to (47 / 60) degrees.
depressionAngle - the depression angle of sun used in sunrise/sunset-calculationsIllegalArgumentException - if the depression angle is not a rational number in range -10.0 <= x <= 10.0public HinduVariant withAlternativeLocation(GeoLocation location)
Creates a copy of this variant with an alternative geographical location.
By default, the location of the Holy City Ujjain is used.
Note: The old Hindu calendar is not customizable.
location - alternative geographical locationIllegalArgumentException - if the absolute latitude is beyond 60 degreesCopyright © 2014–2021. All rights reserved.