|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.icu.util.Calendar
com.ibm.icu.util.IndianCalendar
public class IndianCalendar
IndianCalendar
is a subclass of GregorianCalendar
that numbers years since the birth of the Buddha. This is the civil calendar
which is accepted by government of India as Indian National Calendar.
The two calendars most widely used in India today are the Vikrama calendar
followed in North India and the Shalivahana or Saka calendar which is followed
in South India and Maharashtra.
A variant of the Shalivahana Calendar was reformed and standardized as the
Indian National calendar in 1957.
Some details of Indian National Calendar (to be implemented) : The Months Month Length Start date (Gregorian) ================================================= 1 Chaitra 30/31 March 22* 2 Vaisakha 31 April 21 3 Jyaistha 31 May 22 4 Asadha 31 June 22 5 Sravana 31 July 23 6 Bhadra 31 August 23 7 Asvina 30 September 23 8 Kartika 30 October 23 9 Agrahayana 30 November 22 10 Pausa 30 December 22 11 Magha 30 January 21 12 Phalguna 30 February 20 In leap years, Chaitra has 31 days and starts on March 21 instead. The leap years of Gregorian calendar and Indian National Calendar are in synchornization. So When its a leap year in Gregorian calendar then Chaitra has 31 days. The Years Years are counted in the Saka Era, which starts its year 0 in 78AD (by gregorian calendar). So for eg. 9th June 2006 by Gregorian Calendar, is same as 19th of Jyaistha in 1928 of Saka era by Indian National Calendar.
The Indian Calendar has only one allowable era: Saka Era
. If the
calendar is not in lenient mode (see setLenient
), dates before
1/1/1 Saka Era are rejected with an IllegalArgumentException
.
This class should not be subclassed.
IndianCalendar usually should be instantiated using
Calendar.getInstance(ULocale)
passing in a ULocale
with the tag "@calendar=Indian"
.
Calendar
,
GregorianCalendar
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class com.ibm.icu.util.Calendar |
---|
Calendar.FormatConfiguration |
Field Summary | |
---|---|
static int |
AGRAHAYANA
Constant for Agrahayana, the 9th month of the Indian year. |
static int |
ASADHA
Constant for Asadha, the 4th month of the Indian year. |
static int |
ASVINA
Constant for Asvina, the 7th month of the Indian year. |
static int |
BHADRA
Constant for Bhadra, the 6th month of the Indian year. |
static int |
CHAITRA
Constant for Chaitra, the 1st month of the Indian year. |
static int |
IE
Constant for the Indian Era. |
static int |
JYAISTHA
Constant for Jyaistha, the 3rd month of the Indian year. |
static int |
KARTIKA
Constant for Kartika, the 8th month of the Indian year. |
static int |
MAGHA
Constant for Magha, the 11th month of the Indian year. |
static int |
PAUSA
Constant for Pausa, the 10th month of the Indian year. |
static int |
PHALGUNA
Constant for Phalguna, the 12th month of the Indian year. |
static int |
SRAVANA
Constant for Sravana, the 5th month of the Indian year. |
static int |
VAISAKHA
Constant for Vaisakha, the 2nd month of the Indian year. |
Fields inherited from class com.ibm.icu.util.Calendar |
---|
AM, AM_PM, APRIL, AUGUST, BASE_FIELD_COUNT, DATE, DAY_OF_MONTH, DAY_OF_WEEK, DAY_OF_WEEK_IN_MONTH, DAY_OF_YEAR, DECEMBER, DOW_LOCAL, DST_OFFSET, EPOCH_JULIAN_DAY, ERA, EXTENDED_YEAR, FEBRUARY, FRIDAY, GREATEST_MINIMUM, HOUR, HOUR_OF_DAY, INTERNALLY_SET, JAN_1_1_JULIAN_DAY, JANUARY, JULIAN_DAY, JULY, JUNE, LEAST_MAXIMUM, MARCH, MAX_DATE, MAX_FIELD_COUNT, MAX_JULIAN, MAX_MILLIS, MAXIMUM, MAY, MILLISECOND, MILLISECONDS_IN_DAY, MIN_DATE, MIN_JULIAN, MIN_MILLIS, MINIMUM, MINIMUM_USER_STAMP, MINUTE, MONDAY, MONTH, NOVEMBER, OCTOBER, ONE_DAY, ONE_HOUR, ONE_MINUTE, ONE_SECOND, ONE_WEEK, PM, RESOLVE_REMAP, SATURDAY, SECOND, SEPTEMBER, SUNDAY, THURSDAY, TUESDAY, UNDECIMBER, UNSET, WEDNESDAY, WEEK_OF_MONTH, WEEK_OF_YEAR, WEEKDAY, WEEKEND, WEEKEND_CEASE, WEEKEND_ONSET, YEAR, YEAR_WOY, ZONE_OFFSET |
Constructor Summary | |
---|---|
IndianCalendar()
Constructs a IndianCalendar using the current time
in the default time zone with the default locale. |
|
IndianCalendar(Date date)
Constructs a IndianCalendar with the given date set
in the default time zone with the default locale. |
|
IndianCalendar(int year,
int month,
int date)
Constructs a IndianCalendar with the given date set
in the default time zone with the default locale. |
|
IndianCalendar(int year,
int month,
int date,
int hour,
int minute,
int second)
Constructs a IndianCalendar with the given date and time set for the default time zone with the default locale. |
|
IndianCalendar(Locale aLocale)
Constructs a IndianCalendar based on the current time
in the default time zone with the given locale. |
|
IndianCalendar(TimeZone zone)
Constructs a IndianCalendar based on the current time
in the given time zone with the default locale. |
|
IndianCalendar(TimeZone zone,
Locale aLocale)
Constructs a IndianCalendar based on the current time
in the given time zone with the given locale. |
|
IndianCalendar(TimeZone zone,
ULocale locale)
Constructs a IndianCalendar based on the current time
in the given time zone with the given locale. |
|
IndianCalendar(ULocale locale)
Constructs a IndianCalendar based on the current time
in the default time zone with the given locale. |
Method Summary | |
---|---|
String |
getType()
Return the current Calendar type. |
protected void |
handleComputeFields(int julianDay)
Subclasses may override this method to compute several fields specific to each calendar system. |
protected int |
handleComputeMonthStart(int year,
int month,
boolean useMonth)
Return the Julian day number of day before the first day of the given month in the given extended year. |
protected int |
handleGetExtendedYear()
Return the extended year defined by the current fields. |
protected int |
handleGetLimit(int field,
int limitType)
Subclass API for defining limits of different types. |
protected int |
handleGetMonthLength(int extendedYear,
int month)
Return the number of days in the given month of the given extended year of this calendar system. |
protected int |
handleGetYearLength(int extendedYear)
Return the number of days in the given extended year of this calendar system. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int CHAITRA
public static final int VAISAKHA
public static final int JYAISTHA
public static final int ASADHA
public static final int SRAVANA
public static final int BHADRA
public static final int ASVINA
public static final int KARTIKA
public static final int AGRAHAYANA
public static final int PAUSA
public static final int MAGHA
public static final int PHALGUNA
public static final int IE
ERA
value for the Indian calendar.
Calendar.ERA
,
Constant Field ValuesConstructor Detail |
---|
public IndianCalendar()
IndianCalendar
using the current time
in the default time zone with the default locale.
public IndianCalendar(TimeZone zone)
IndianCalendar
based on the current time
in the given time zone with the default locale.
zone
- the given time zone.public IndianCalendar(Locale aLocale)
IndianCalendar
based on the current time
in the default time zone with the given locale.
aLocale
- the given locale.public IndianCalendar(ULocale locale)
IndianCalendar
based on the current time
in the default time zone with the given locale.
locale
- the given ulocale.public IndianCalendar(TimeZone zone, Locale aLocale)
IndianCalendar
based on the current time
in the given time zone with the given locale.
zone
- the given time zone.aLocale
- the given locale.public IndianCalendar(TimeZone zone, ULocale locale)
IndianCalendar
based on the current time
in the given time zone with the given locale.
zone
- the given time zone.locale
- the given ulocale.public IndianCalendar(Date date)
IndianCalendar
with the given date set
in the default time zone with the default locale.
date
- The date to which the new calendar is set.public IndianCalendar(int year, int month, int date)
IndianCalendar
with the given date set
in the default time zone with the default locale.
year
- The value used to set the calendar's YEAR
time field.month
- The value used to set the calendar's MONTH
time field.
The value is 0-based. e.g., 0 for January.date
- The value used to set the calendar's DATE
time field.public IndianCalendar(int year, int month, int date, int hour, int minute, int second)
year
- The value used to set the calendar's YEAR
time field.month
- The value used to set the calendar's MONTH
time field.
The value is 0-based. e.g., 0 for January.date
- The value used to set the calendar's DATE
time field.hour
- The value used to set the calendar's HOUR_OF_DAY
time field.minute
- The value used to set the calendar's MINUTE
time field.second
- The value used to set the calendar's SECOND
time field.Method Detail |
---|
protected int handleGetExtendedYear()
handleGetExtendedYear
in class Calendar
protected int handleGetYearLength(int extendedYear)
handleGetYearLength
in class Calendar
protected int handleGetMonthLength(int extendedYear, int month)
handleGetMonthLength
in class Calendar
protected void handleComputeFields(int julianDay)
In addition, subclasses should compute any subclass-specific fields, that is, fields from BASE_FIELD_COUNT to getFieldCount() - 1.
The default implementation in Calendar
implements
a pure proleptic Gregorian calendar.
handleComputeFields
in class Calendar
protected int handleGetLimit(int field, int limitType)
ERA YEAR MONTH WEEK_OF_YEAR WEEK_OF_MONTH DAY_OF_MONTH DAY_OF_YEAR DAY_OF_WEEK_IN_MONTH YEAR_WOY EXTENDED_YEAR
handleGetLimit
in class Calendar
field
- one of the above field numberslimitType
- one of MINIMUM
, GREATEST_MINIMUM
,
LEAST_MAXIMUM
, or MAXIMUM
protected int handleComputeMonthStart(int year, int month, boolean useMonth)
handleComputeMonthStart
in class Calendar
year
- the extended yearmonth
- the zero-based month, or 0 if useMonth is falseuseMonth
- if false, compute the day before the first day of
the given year, otherwise, compute the day before the first day of
the given month
public String getType()
getType
in class Calendar
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |