public class UmmalquraCalendar extends GregorianCalendar
Calendar.Builder| Modifier and Type | Field and Description |
|---|---|
protected int[] |
hFields
The calendar field values for the currently set time for this calendar.
|
static int |
JUMADA_AWWAL
Value of the
Calendar.MONTH field indicating the
fifth month of the year in the Ummalqura calendar. |
static int |
JUMADA_THANI
Value of the
Calendar.MONTH field indicating the
sixth month of the year in the Ummalqura calendar. |
static int |
MUHARRAM
Value of the
Calendar.MONTH field indicating the
first month of the year in the Ummalqura calendar. |
static int |
RABI_AWWAL
Value of the
Calendar.MONTH field indicating the
third month of the year in the Ummalqura calendar. |
static int |
RABI_THANI
Value of the
Calendar.MONTH field indicating the
fourth month of the year in the Ummalqura calendar. |
static int |
RAJAB
Value of the
Calendar.MONTH field indicating the
seventh month of the year in the Ummalqura calendar. |
static int |
RAMADHAN
Value of the
Calendar.MONTH field indicating the
ninth month of the year in the Ummalqura calendar. |
static int |
SAFAR
Value of the
Calendar.MONTH field indicating the
second month of the year in the Ummalqura calendar. |
static int |
SHAABAN
Value of the
Calendar.MONTH field indicating the
eighth month of the year in the Ummalqura calendar. |
static int |
SHAWWAL
Value of the
Calendar.MONTH field indicating the
tenth month of the year in the Ummalqura calendar. |
static int |
THUL_HIJJAH
Value of the
Calendar.MONTH field indicating the
twelfth month of the year in the Ummalqura calendar. |
static int |
THUL_QIDAH
Value of the
Calendar.MONTH field indicating the
eleventh month of the year in the Ummalqura calendar. |
AD, BCALL_STYLES, AM, AM_PM, APRIL, areFieldsSet, AUGUST, DATE, DAY_OF_MONTH, DAY_OF_WEEK, DAY_OF_WEEK_IN_MONTH, DAY_OF_YEAR, DECEMBER, DST_OFFSET, ERA, FEBRUARY, FIELD_COUNT, fields, FRIDAY, HOUR, HOUR_OF_DAY, isSet, isTimeSet, JANUARY, JULY, JUNE, LONG, LONG_FORMAT, LONG_STANDALONE, MARCH, MAY, MILLISECOND, MINUTE, MONDAY, MONTH, NARROW_FORMAT, NARROW_STANDALONE, NOVEMBER, OCTOBER, PM, SATURDAY, SECOND, SEPTEMBER, SHORT, SHORT_FORMAT, SHORT_STANDALONE, SUNDAY, THURSDAY, time, TUESDAY, UNDECIMBER, WEDNESDAY, WEEK_OF_MONTH, WEEK_OF_YEAR, YEAR, ZONE_OFFSET| Constructor and Description |
|---|
UmmalquraCalendar()
Constructs a default
UmmalquraCalendar using the current time
in the default time zone with the default locale. |
UmmalquraCalendar(int year,
int month,
int dayOfMonth)
Constructs a
UmmalquraCalendar with the given date set
in the default time zone with the default locale. |
UmmalquraCalendar(int year,
int month,
int dayOfMonth,
int hourOfDay,
int minute)
Constructs a
UmmalquraCalendar with the given date
and time set for the default time zone with the default locale. |
UmmalquraCalendar(int year,
int month,
int dayOfMonth,
int hourOfDay,
int minute,
int second)
Constructs a
UmmalquraCalendar with the given date
and time set for the default time zone with the default locale. |
UmmalquraCalendar(Locale aLocale)
Constructs a
UmmalquraCalendar based on the current time
in the default time zone with the given locale. |
UmmalquraCalendar(TimeZone zone,
Locale aLocale)
Constructs a
UmmalquraCalendar based on the current time
in the given time zone with the given locale. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
computeFields() |
boolean |
equals(Object obj) |
int |
get(int field) |
String |
getDisplayName(int field,
int style,
Locale locale)
Returns the string representation of the calendar
field value in the given style and
locale. |
Map<String,Integer> |
getDisplayNames(int field,
int style,
Locale locale)
Returns a
Map containing all names of the calendar
field in the given style and
locale and their corresponding field values. |
int |
hashCode() |
int |
lengthOfMonth()
Returns the length of the month represented by this calendar.
|
static int |
lengthOfMonth(int year,
int month)
Returns the length of a Hijri month in a Hijri year.
|
int |
lengthOfYear()
Returns the length of the year represented by this calendar.
|
static int |
lengthOfYear(int year)
Returns the length of the given year.
|
void |
set(int field,
int value) |
add, clone, computeTime, from, getActualMaximum, getActualMinimum, getCalendarType, getGreatestMinimum, getGregorianChange, getLeastMaximum, getMaximum, getMinimum, getTimeZone, getWeeksInWeekYear, getWeekYear, isLeapYear, isWeekDateSupported, roll, roll, setGregorianChange, setTimeZone, setWeekDate, toZonedDateTimeafter, before, clear, clear, compareTo, complete, getAvailableCalendarTypes, getAvailableLocales, getFirstDayOfWeek, getInstance, getInstance, getInstance, getInstance, getMinimalDaysInFirstWeek, getTime, getTimeInMillis, internalGet, isLenient, isSet, set, set, set, setFirstDayOfWeek, setLenient, setMinimalDaysInFirstWeek, setTime, setTimeInMillis, toInstant, toStringpublic static final int MUHARRAM
Calendar.MONTH field indicating the
first month of the year in the Ummalqura calendar.public static final int SAFAR
Calendar.MONTH field indicating the
second month of the year in the Ummalqura calendar.public static final int RABI_AWWAL
Calendar.MONTH field indicating the
third month of the year in the Ummalqura calendar.public static final int RABI_THANI
Calendar.MONTH field indicating the
fourth month of the year in the Ummalqura calendar.public static final int JUMADA_AWWAL
Calendar.MONTH field indicating the
fifth month of the year in the Ummalqura calendar.public static final int JUMADA_THANI
Calendar.MONTH field indicating the
sixth month of the year in the Ummalqura calendar.public static final int RAJAB
Calendar.MONTH field indicating the
seventh month of the year in the Ummalqura calendar.public static final int SHAABAN
Calendar.MONTH field indicating the
eighth month of the year in the Ummalqura calendar.public static final int RAMADHAN
Calendar.MONTH field indicating the
ninth month of the year in the Ummalqura calendar.public static final int SHAWWAL
Calendar.MONTH field indicating the
tenth month of the year in the Ummalqura calendar.public static final int THUL_QIDAH
Calendar.MONTH field indicating the
eleventh month of the year in the Ummalqura calendar.public static final int THUL_HIJJAH
Calendar.MONTH field indicating the
twelfth month of the year in the Ummalqura calendar.protected int[] hFields
FIELD_COUNT integers, with index values
ERA through DST_OFFSET.public UmmalquraCalendar()
UmmalquraCalendar using the current time
in the default time zone with the default locale.public UmmalquraCalendar(Locale aLocale)
UmmalquraCalendar based on the current time
in the default time zone with the given locale.aLocale - the given locale.public UmmalquraCalendar(TimeZone zone, Locale aLocale)
UmmalquraCalendar based on the current time
in the given time zone with the given locale.zone - the given time zone.aLocale - the given locale.public UmmalquraCalendar(int year,
int month,
int dayOfMonth)
UmmalquraCalendar with the given date set
in the default time zone with the default locale.year - the value used to set the YEAR calendar field in the calendar.month - the value used to set the MONTH calendar field in the calendar.
Month value is 0-based. e.g., 0 for Muharram.dayOfMonth - the value used to set the DAY_OF_MONTH calendar field in the calendar.public UmmalquraCalendar(int year,
int month,
int dayOfMonth,
int hourOfDay,
int minute)
UmmalquraCalendar with the given date
and time set for the default time zone with the default locale.year - the value used to set the YEAR calendar field in the calendar.month - the value used to set the MONTH calendar field in the calendar.
Month value is 0-based. e.g., 0 for Muharram.dayOfMonth - the value used to set the DAY_OF_MONTH calendar field in the calendar.hourOfDay - the value used to set the HOUR_OF_DAY calendar field
in the calendar.minute - the value used to set the MINUTE calendar field
in the calendar.public UmmalquraCalendar(int year,
int month,
int dayOfMonth,
int hourOfDay,
int minute,
int second)
UmmalquraCalendar with the given date
and time set for the default time zone with the default locale.year - the value used to set the YEAR calendar field in the calendar.month - the value used to set the MONTH calendar field in the calendar.
Month value is 0-based. e.g., 0 for Muharram.dayOfMonth - the value used to set the DAY_OF_MONTH calendar field in the calendar.hourOfDay - the value used to set the HOUR_OF_DAY calendar field
in the calendar.minute - the value used to set the MINUTE calendar field
in the calendar.second - the value used to set the SECOND calendar field
in the calendar.public int lengthOfMonth()
This returns the length of the month in days.
public static int lengthOfMonth(int year,
int month)
This returns the length of the month in days.
year - Hijri yearmonth - Hijri monthpublic int lengthOfYear()
This returns the length of the year in days, either 354 or 355.
public static int lengthOfYear(int year)
This returns the length of the year in days, either 354 or 355.
year - the year to calculate day count for.public String getDisplayName(int field, int style, Locale locale)
field value in the given style and
locale. If no string representation is
applicable, null is returned. This method calls
get(field) to get the calendar
field value if the string representation is
applicable to the given calendar field.
For example, if this Calendar's date is 1437-01-01, then
the string representation of the Calendar.MONTH field would be
"Muharram" in the long style in an English locale or "Muh" in
the short style. However, no string representation would be
available for the Calendar.DAY_OF_MONTH field, and this method
would return null.
The default implementation supports the calendar fields for
which a UmmalquraDateFormatSymbols has names in the given
locale.
getDisplayName in class Calendarfield - the calendar field for which the string representation
is returnedstyle - the style applied to the string representation; one of
Calendar.SHORT or Calendar.LONG.locale - the locale for the string representationfield in the given style, or
null if no string representation is
applicable.IllegalArgumentException - if field or style is invalid,
or if this Calendar is non-lenient and any
of the calendar fields have invalid valuesNullPointerException - if locale is nullpublic Map<String,Integer> getDisplayNames(int field, int style, Locale locale)
Map containing all names of the calendar
field in the given style and
locale and their corresponding field values. For
example, The returned map would contain "Muh" to
MUHARRAM, "Saf" to SAFAR, and so on, in the
short style in an English locale.
The values of other calendar fields may be taken into
account to determine a set of display names. For example, if
this Calendar is a lunisolar calendar system and
the year value given by the Calendar.YEAR field has a leap
month, this method would return month names containing the leap
month name, and month names are mapped to their values specific
for the year.
This implementation supports display names contained in
a UmmalquraDateFormatSymbols. For example, if field
is Calendar.MONTH and style is Calendar.ALL_STYLES, this method returns a Map containing
all strings returned by UmmalquraDateFormatSymbols.getShortMonths()
and UmmalquraDateFormatSymbols.getMonths().
getDisplayNames in class Calendarfield - the calendar field for which the display names are returnedstyle - the style applied to the display names; one of Calendar.SHORT, Calendar.LONG, or Calendar.ALL_STYLES.locale - the locale for the display namesMap containing all display names in
style and locale and their
field values, or null if no display names
are defined for fieldIllegalArgumentException - if field or style is invalid,
or if this Calendar is non-lenient and any
of the calendar fields have invalid valuesNullPointerException - if locale is nullpublic boolean equals(Object obj)
equals in class GregorianCalendarpublic int hashCode()
hashCode in class GregorianCalendarprotected void computeFields()
computeFields in class GregorianCalendarCopyright © 2015. All rights reserved.