Class IslamicCalendar.UmalquraAlgorithm

    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private UmalquraAlgorithm()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void compute​(long julianDays, long current, java.util.function.IntConsumer yearConsumer, java.util.function.IntConsumer monthConsumer, java.util.function.IntConsumer dayOfMonthConsumer, java.util.function.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.
      long epoch()
      Return the epoch used by this algorithm.
      IslamicCalendar.CalculationType getType()
      Return the type the algorithm implement.
      boolean isCivil()
      Returns true if this object is using the fixed-cycle civil calendar, or false if using the religious, astronomical calendar.
      int monthLength​(int year, int month)
      Return the length (in days) of the given month.
      long monthStart​(int year, int month)
      Return the day # on which the given month starts.
      int yearLength​(int year)
      Return the length (in days) of the given year.
      long yearStart​(int year)
      Return the day # on which the given year starts.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UmalquraAlgorithm

        private UmalquraAlgorithm()
    • Method Detail

      • isCivil

        public boolean isCivil()
        Description copied from interface: IslamicCalendar.Algorithm
        Returns true if this object is using the fixed-cycle civil calendar, or false if using the religious, astronomical calendar.
        Specified by:
        isCivil in interface IslamicCalendar.Algorithm
      • yearStart

        public long yearStart​(int year)
        Description copied from interface: IslamicCalendar.Algorithm
        Return the day # on which the given year starts. Days are counted from the Hijri epoch, origin 0.
        Specified by:
        yearStart in interface IslamicCalendar.Algorithm
        Parameters:
        year - The hijri year
      • monthStart

        public long monthStart​(int year,
                               int month)
        Description copied from interface: IslamicCalendar.Algorithm
        Return the day # on which the given month starts. Days are counted from the Hijri epoch, origin 0.
        Specified by:
        monthStart in interface IslamicCalendar.Algorithm
        Parameters:
        year - The hijri year
        month - The hijri month, 0-based
      • monthLength

        public int monthLength​(int year,
                               int month)
        Description copied from interface: IslamicCalendar.Algorithm
        Return the length (in days) of the given month.
        Specified by:
        monthLength in interface IslamicCalendar.Algorithm
        Parameters:
        year - The hijri year
        month - The hijri month, 0-based
      • compute

        public void compute​(long julianDays,
                            long current,
                            java.util.function.IntConsumer yearConsumer,
                            java.util.function.IntConsumer monthConsumer,
                            java.util.function.IntConsumer dayOfMonthConsumer,
                            java.util.function.IntConsumer dayOfYearConsumer)
        Description copied from interface: IslamicCalendar.Algorithm
        Compute the year, month, dayOfMonth, and dayOfYear of the given julian days and current time and feed the caculuated results to the consumers.
        Specified by:
        compute in interface IslamicCalendar.Algorithm
        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.