public class IslamicCalendarMetrics extends NoLeapMonthCalendarMetrics
| Modifier and Type | Class and Description |
|---|---|
static class |
IslamicCalendarMetrics.IslamicCalendarMetricsFactory |
static class |
IslamicCalendarMetrics.LeapYearPattern |
CalendarMetrics.CalendarMetricsFactory| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
CALENDAR_SCALE_CIVIL |
static java.lang.String |
CALENDAR_SCALE_TLBA |
static long |
DAYS_PER_CYCLE |
static byte[][] |
LEAP_YEAR_COUNT
One array per
IslamicCalendarMetrics.LeapYearPattern that contains the number of leap days that occurred up to a particular year in the 30 year cycle. |
static int[] |
LEAP_YEAR_PATTERNS
An array of (packed) patterns based on different leap year rules.
|
static long |
MILLIS_PER_CYCLE |
static long |
MILLIS_PER_DAY |
static long |
MILLIS_TO_1389_10_22C
This is the number of milliseconds between {I}0001-01-01 (civil scale) and {I}1389-10-22 (civil scale) (i.e.
|
static Weekday[] |
WEEKDAYS
An array of
Weekdays. |
minDaysInFirstWeek, weekStart, weekStartInt| Constructor and Description |
|---|
IslamicCalendarMetrics(java.lang.String name,
Weekday weekStart,
int minDaysInFirstWeek,
IslamicCalendarMetrics.LeapYearPattern leapYearPatternIndex,
boolean civil)
Create calendar metrics for an Islamic calendar with the given week numbering.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getDayOfMonthOfYearDay(int year,
int yearDay)
Determines the day of month for a given day of year.
|
int |
getDayOfYear(int year,
int packedMonth,
int dayOfMonth)
Get the day of the year for the specified date.
|
int |
getDaysPerPackedMonth(int year,
int packedMonth)
Get the number of days in a specific packed month.
|
int |
getDaysPerYear(int year)
Get the number of days in the given year.
|
int |
getMaxMonthDayNum()
Returns the largest month day number that the current calendar supports.
|
int |
getMaxWeekNoNum()
Returns the largest week number that the current calendar supports.
|
int |
getMaxYearDayNum()
Returns the largest year day number that the current calendar supports.
|
int |
getMonthAndDayOfYearDay(int year,
int yearDay)
Determines the month and day for a given day of year.
|
int |
getMonthsPerYear()
Returns the number of months in a year.
|
int |
getPackedMonthOfYearDay(int year,
int yearDay)
Determines the month of a given day of year.
|
int |
getWeekDayOfFirstYearDay(int year)
Get the weekday of the first day (which is January the 1st in a Gregorian Calendar) in the given year.
|
int |
getWeekOfYear(int year,
int yearDay)
Get the ISO week number of the given date.
|
int |
getWeeksPerYear(int year)
Get the number of ISO weeks in the given year.
|
int |
getYearDayOfFirstWeekStart(int year)
Get the day of year of the start of the first week in a year.
|
int |
getYearDayOfIsoYear(int year,
int weekOfYear,
int dayOfWeek)
Get the day of the year for the specified ISO week date, see ISO week date
If the day belongs to the previous year zero or a negative value is returned.
|
int |
getYearDayOfWeekStart(int year,
int week)
Get the day of year of the start of the given week in a year.
|
int |
getYearDaysForPackedMonth(int year,
int packedMonth)
Get the number of days preceding the given month in the given year.
|
long |
toGregorian(long islamicInstance)
Convert the given Islamic instance to Gregorian calendar.
|
long |
toInstance(long timestamp,
java.util.TimeZone timeZone)
Converts a timestamp to an instance in the given
TimeZone. |
long |
toMillis(java.util.TimeZone timeZone,
int year,
int packedMonth,
int dayOfMonth,
int hours,
int minutes,
int seconds,
int millis)
Convert the given (local) date to milliseconds since the epoch using the given
TimeZone. |
getMonthsPerYear, isLeapMonth, monthNum, nextDay, nextDay, nextMonth, nextMonth, packedMonth, packedMonth, packedMonthToString, prevDay, prevDay, prevMonth, prevMonthdayOfMonth, equals, getDayOfWeek, getDayOfWeek, getWeekOfYear, hashCode, monthAndDay, packedMonth, scaleEquals, setDayOfWeek, startOfWeek, toMillis, toString, validatepublic static final long DAYS_PER_CYCLE
public static final long MILLIS_PER_DAY
public static final long MILLIS_PER_CYCLE
public static final long MILLIS_TO_1389_10_22C
public static final java.lang.String CALENDAR_SCALE_TLBA
public static final java.lang.String CALENDAR_SCALE_CIVIL
public static final int[] LEAP_YEAR_PATTERNS
public static final byte[][] LEAP_YEAR_COUNT
IslamicCalendarMetrics.LeapYearPattern that contains the number of leap days that occurred up to a particular year in the 30 year cycle.public static final Weekday[] WEEKDAYS
public IslamicCalendarMetrics(java.lang.String name,
Weekday weekStart,
int minDaysInFirstWeek,
IslamicCalendarMetrics.LeapYearPattern leapYearPatternIndex,
boolean civil)
weekStart - The first day of the week.minDaysInFirstWeek - The minimal number of days in the first week.public int getMaxMonthDayNum()
CalendarMetricsgetMaxMonthDayNum in class CalendarMetricspublic int getMaxYearDayNum()
CalendarMetricsgetMaxYearDayNum in class CalendarMetricspublic int getMaxWeekNoNum()
CalendarMetricsgetMaxWeekNoNum in class CalendarMetricspublic int getDaysPerPackedMonth(int year,
int packedMonth)
CalendarMetricsgetDaysPerPackedMonth in class CalendarMetricsyear - The year.packedMonth - The packed month.public int getYearDaysForPackedMonth(int year,
int packedMonth)
CalendarMetricsgetYearDaysForPackedMonth in class CalendarMetricsyear - The year.packedMonth - The packed month.public int getMonthsPerYear()
NoLeapMonthCalendarMetricsgetMonthsPerYear in class NoLeapMonthCalendarMetricspublic int getDaysPerYear(int year)
CalendarMetricsgetDaysPerYear in class CalendarMetricsyear - The year.public int getWeeksPerYear(int year)
CalendarMetricsgetWeeksPerYear in class CalendarMetricsyear - The year.public int getWeekOfYear(int year,
int yearDay)
CalendarMetrics
Note: this will return 0 if the week belongs to the previous ISO year and a value greater than CalendarMetrics.getWeeksPerYear(int) if the week
belongs to the next ISO year.
getWeekOfYear in class CalendarMetricsyear - The year.yearDay - The day of year.public int getDayOfYear(int year,
int packedMonth,
int dayOfMonth)
CalendarMetricsgetDayOfYear in class CalendarMetricsyear - The year.packedMonth - The packed month.dayOfMonth - The day of month.public int getWeekDayOfFirstYearDay(int year)
CalendarMetricsgetWeekDayOfFirstYearDay in class CalendarMetricsyear - The year.public int getYearDayOfFirstWeekStart(int year)
CalendarMetricsCalendarMetrics.weekStart and CalendarMetrics.minDaysInFirstWeek.getYearDayOfFirstWeekStart in class CalendarMetricsyear - The year.public int getPackedMonthOfYearDay(int year,
int yearDay)
CalendarMetricsgetPackedMonthOfYearDay in class CalendarMetricsyear - The year.yearDay - The year day.public int getDayOfMonthOfYearDay(int year,
int yearDay)
CalendarMetricsgetDayOfMonthOfYearDay in class CalendarMetricsyear - The year.yearDay - The year day.public int getMonthAndDayOfYearDay(int year,
int yearDay)
CalendarMetricsCalendarMetrics.packedMonth(int) and CalendarMetrics.dayOfMonth(int) like in:
int monthAndDay = mCalendarMetrics.getMonthAndDayOfYearDay(year, yearDay); int month = CalendarMetrics.packedMonth(monthAndDay); int dayOfMonth = CalendarMetrics.dayOfMonth(monthAndDay);
getMonthAndDayOfYearDay in class CalendarMetricsyear - The year.yearDay - The day of the year. Must be a valid value between 1 and the maximum number of days in that year.public int getYearDayOfIsoYear(int year,
int weekOfYear,
int dayOfWeek)
CalendarMetrics
If the day belongs to the previous year zero or a negative value is returned. If the day belongs to the next year the result is larger than CalendarMetrics.getDaysPerYear(int) for year.
getYearDayOfIsoYear in class CalendarMetricsyear - The year.weekOfYear - The ISO week of the year.dayOfWeek - The day of the week.public int getYearDayOfWeekStart(int year,
int week)
CalendarMetricsCalendarMetrics.weekStart and CalendarMetrics.minDaysInFirstWeek.getYearDayOfWeekStart in class CalendarMetricsyear - The year.week - The week.public long toMillis(java.util.TimeZone timeZone,
int year,
int packedMonth,
int dayOfMonth,
int hours,
int minutes,
int seconds,
int millis)
CalendarMetricsTimeZone.toMillis in class CalendarMetricstimeZone - The time zone or null for floating dates (and all-day dates).year - The year.packedMonth - The packed month.dayOfMonth - The day of the month.hours - The hour of the day.minutes - The minutes.seconds - The seconds.millis - The milliseconds.public long toInstance(long timestamp,
java.util.TimeZone timeZone)
CalendarMetricsTimeZone.toInstance in class CalendarMetricstimestamp - The time in milliseconds since the epoch.timeZone - The time zone, may be null in which case UTC will be used.public long toGregorian(long islamicInstance)
islamicInstance - An Instance value in islamic calendar scale.