Class HinduVariant
- All Implemented Interfaces:
Serializable
,VariantSource
The Hindu calendar variants differ on various sets of calculations, month names and the choice of era.
- Since:
- 5.6
- Author:
- Meno Hochschild
- See Also:
- Serialized Form
-
Method Summary
Modifier and TypeMethodDescriptionboolean
static HinduVariant
Parses given variant string.Obtains the default era.Obtains the geographical reference point which is usually the holy city of Ujjain.Yields the variant name of a calendar system.int
hashCode()
boolean
isAmanta()
Determines if this variant describes the amanta scheme.boolean
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
Determines if this variant describes the purnimanta scheme.boolean
isSolar()
Determines if this variant describes the solar Hindu calendar.boolean
Does this variant use elapsed years?toString()
Creates a copy of this variant with given preferred era.Deprecated.withAlternativeLocation(GeoLocation location)
Creates a copy of this variant with an alternative geographical location.Creates a copy of this variant with current years.Creates a copy of this variant with elapsed years.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.
-
Method Details
-
from
Parses given variant string.
The variant string is the same as created by calling
getVariant()
.- Parameters:
variant
- variant string- Returns:
- parsed variant
- Throws:
IllegalArgumentException
- if given argument cannot be parsed- See Also:
getVariant()
,HinduRule.variant()
,AryaSiddhanta.variant()
-
getDefaultEra
Obtains the default era.
- Returns:
- HinduEra
-
getLocation
Obtains the geographical reference point which is usually the holy city of Ujjain.
- Returns:
- GeoLocation
-
isSolar
public boolean isSolar()Determines if this variant describes the solar Hindu calendar.
- Returns:
- boolean
-
isLunisolar
public boolean isLunisolar()Determines if this variant describes the lunisolar Hindu calendar.
Lunisolar variants follow either the amanta or the purnimanta scheme.
- Returns:
- boolean
- See Also:
isAmanta()
,isPurnimanta()
-
isAmanta
public boolean isAmanta()Determines if this variant describes the amanta scheme.
Months are synchronized with the New Moon.
- Returns:
- boolean
-
isPurnimanta
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.
- Returns:
- boolean
-
isOld
public boolean isOld()Determines if this variant describes the old Hindu calendar based on mean astronomical values.
- Returns:
- boolean
-
isUsingElapsedYears
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.
- Returns:
- boolean
- See Also:
withElapsedYears()
,withCurrentYears()
-
equals
-
hashCode
public int hashCode() -
toString
-
getVariant
Description copied from interface:VariantSource
Yields the variant name of a calendar system.
- Specified by:
getVariant
in interfaceVariantSource
- Returns:
- String which is empty if there are no variants
-
with
Creates a copy of this variant with given preferred era.
Note: The old Hindu calendar is not customizable.
- Parameters:
defaultEra
- the new deviating era- Returns:
- modified copy or this variant if the era does not change
-
withElapsedYears
Creates a copy of this variant with elapsed years.
Note: Elapsed years count one less than current years.
- Returns:
- modified copy or this variant if the elapsed year mode does not change
- See Also:
withCurrentYears()
,isUsingElapsedYears()
-
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.
- Returns:
- modified copy or this variant if the elapsed year mode does not change
- See Also:
withElapsedYears()
,isUsingElapsedYears()
-
withAlternativeHinduSunrise
Deprecated.UsewithModernAstronomy(double)
insteadOutdated method without any effect.
- Returns:
- this variant (unchanged)
-
withModernAstronomy
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.- Parameters:
depressionAngle
- the depression angle of sun used in sunrise/sunset-calculations- Returns:
- modified copy or this variant if in old style (Arya-Siddhanta)
- Throws:
IllegalArgumentException
- if the depression angle is not a rational number in range -10.0 <= x <= 10.0
-
withAlternativeLocation
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.
- Parameters:
location
- alternative geographical location- Returns:
- modified copy or this variant if the location does not change
- Throws:
IllegalArgumentException
- if the absolute latitude is beyond 60 degrees
-
withModernAstronomy(double)
instead