public interface HijriData
Generic interface for loading and representing any local variant of Hijri data.
Typical implementations might be based either on file resources or on SQL databases. A sensible approach looks such that a database table has 12 columns where every cell contains the length of month in the associated Hijri year (per row).
| Modifier and Type | Method and Description |
|---|---|
PlainDate |
firstGregorianDate()
Obtains the gregorian date of first day and month in minimum Hijri year.
|
int |
lengthOfMonth(int hijriYear,
int hijriMonth)
Obtains the length of given month in days.
|
int |
maximumYear()
Obtains the maximum supported Hijri year.
|
int |
minimumYear()
Obtains the minimum supported Hijri year.
|
String |
name()
Obtains the name of the associated Hijri calendar variant.
|
void |
prepare()
Initializes the data.
|
default String |
version()
Determines the data version (optional).
|
void prepare()
Initializes the data.
This method will be called by Time4J every time when the data have to be registered. A typical implementation might read a SQL database and load an internal array cache in order to avoid excessive calls of database.
IllegalStateException - if the initialization failsHijriCalendar.register(HijriData)String name()
Obtains the name of the associated Hijri calendar variant.
The full calendar type is created by prefixing the name with "islamic-". For example: The calendar of Saudi-Arabia with the name "umalqura" has the calendar type and full variant name "islamic-umalqura".
default String version()
Determines the data version (optional).
This method serves for data analysis only.
int minimumYear()
Obtains the minimum supported Hijri year.
int maximumYear()
Obtains the maximum supported Hijri year.
PlainDate firstGregorianDate()
Obtains the gregorian date of first day and month in minimum Hijri year.
int lengthOfMonth(int hijriYear,
int hijriMonth)
Obtains the length of given month in days.
The hijriYear-parameter is always in the range minimumYear()-maximumYear().
hijriYear - the Hijri year which contains the month in questionhijriMonth - the Hijri month in the range 1-12minimumYear(),
maximumYear()Copyright © 2014–2021. All rights reserved.