Package com.ibm.icu.util
Class IslamicCalendar.CivilAlgorithm
java.lang.Object
com.ibm.icu.util.IslamicCalendar.CivilAlgorithm
- All Implemented Interfaces:
IslamicCalendar.Algorithm
- Direct Known Subclasses:
IslamicCalendar.TBLAAlgorithm
- Enclosing class:
IslamicCalendar
private static class IslamicCalendar.CivilAlgorithm
extends Object
implements IslamicCalendar.Algorithm
Algorithm which implement the rules for CalculationType.ISLAMIC_CIVIL.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcompute(long julianDays, long current, IntConsumer yearConsumer, IntConsumer monthConsumer, IntConsumer dayOfMonthConsumer, IntConsumer dayOfYearConsumer) Compute the year, month, dayOfMonth, and dayOfYear of the given julian days and current time and feed the caculuated results to the consumers.longepoch()Return the epoch used by this algorithm.getType()Return the type the algorithm implement.booleanisCivil()Returnstrueif this object is using the fixed-cycle civil calendar, orfalseif using the religious, astronomical calendar.intmonthLength(int year, int month) Return the length (in days) of the given month.longmonthStart(int year, int month) Return the day # on which the given month starts.intyearLength(int year) Return the length (in days) of the given year.longyearStart(int year) Return the day # on which the given year starts.
-
Constructor Details
-
CivilAlgorithm
private CivilAlgorithm()
-
-
Method Details
-
isCivil
public boolean isCivil()Description copied from interface:IslamicCalendar.AlgorithmReturnstrueif this object is using the fixed-cycle civil calendar, orfalseif using the religious, astronomical calendar.- Specified by:
isCivilin interfaceIslamicCalendar.Algorithm
-
getType
Description copied from interface:IslamicCalendar.AlgorithmReturn the type the algorithm implement.- Specified by:
getTypein interfaceIslamicCalendar.Algorithm
-
epoch
public long epoch()Description copied from interface:IslamicCalendar.AlgorithmReturn the epoch used by this algorithm.- Specified by:
epochin interfaceIslamicCalendar.Algorithm
-
yearStart
public long yearStart(int year) Description copied from interface:IslamicCalendar.AlgorithmReturn the day # on which the given year starts. Days are counted from the Hijri epoch, origin 0.- Specified by:
yearStartin interfaceIslamicCalendar.Algorithm- Parameters:
year- The hijri year
-
monthStart
public long monthStart(int year, int month) Description copied from interface:IslamicCalendar.AlgorithmReturn the day # on which the given month starts. Days are counted from the Hijri epoch, origin 0.- Specified by:
monthStartin interfaceIslamicCalendar.Algorithm- Parameters:
year- The hijri yearmonth- The hijri month, 0-based
-
monthLength
public int monthLength(int year, int month) Description copied from interface:IslamicCalendar.AlgorithmReturn the length (in days) of the given month.- Specified by:
monthLengthin interfaceIslamicCalendar.Algorithm- Parameters:
year- The hijri yearmonth- The hijri month, 0-based
-
yearLength
public int yearLength(int year) Description copied from interface:IslamicCalendar.AlgorithmReturn the length (in days) of the given year.- Specified by:
yearLengthin interfaceIslamicCalendar.Algorithm- Parameters:
year- The hijri year
-
compute
public void compute(long julianDays, long current, IntConsumer yearConsumer, IntConsumer monthConsumer, IntConsumer dayOfMonthConsumer, IntConsumer dayOfYearConsumer) Description copied from interface:IslamicCalendar.AlgorithmCompute the year, month, dayOfMonth, and dayOfYear of the given julian days and current time and feed the caculuated results to the consumers.- Specified by:
computein interfaceIslamicCalendar.Algorithm- Parameters:
julianDays-current- the time in millisecond.yearConsumer- consumer to take the year result.monthConsumer- consumer to take the month result.dayOfMonthConsumer- consumer to take the dayOfMonth result.dayOfYearConsumer- consumer to take the dayOfYear result.
-