|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Calendar
java.util.GregorianCalendar
com.ghasemkiani.util.SimplePersianCalendar
This class is a subclass of java.util.GregorianCalendar
,
with the added functionality that it can set/get date in the Persian
calendar system.
The algorithms for conversion between Persian and Gregorian calendar systems
are placed in
class.
PersianCalendarHelper
Field Summary | |
---|---|
static java.lang.String[] |
persianMonths
Persian month names. |
static java.lang.String[] |
persianWeekDays
Persian week day names. |
Fields inherited from class java.util.GregorianCalendar |
---|
AD, BC |
Fields inherited from class java.util.Calendar |
---|
AM, AM_PM, APRIL, AUGUST, DATE, DAY_OF_MONTH, DAY_OF_WEEK, DAY_OF_WEEK_IN_MONTH, DAY_OF_YEAR, DECEMBER, DST_OFFSET, ERA, FEBRUARY, FIELD_COUNT, FRIDAY, HOUR, HOUR_OF_DAY, JANUARY, JULY, JUNE, MARCH, MAY, MILLISECOND, MINUTE, MONDAY, MONTH, NOVEMBER, OCTOBER, PM, SATURDAY, SECOND, SEPTEMBER, SUNDAY, THURSDAY, TUESDAY, UNDECIMBER, WEDNESDAY, WEEK_OF_MONTH, WEEK_OF_YEAR, YEAR, ZONE_OFFSET |
Fields inherited from interface com.ghasemkiani.util.PersianCalendarConstants |
---|
ABAN, AZAR, BAHMAN, DEY, ESFAND, FARVARDIN, KHORDAD, MEHR, MORDAD, ORDIBEHESHT, SHAHRIVAR, TIR |
Constructor Summary | |
---|---|
SimplePersianCalendar()
|
Method Summary | |
---|---|
DateFields |
getDateFields()
Retrieves the date of this calendar object as the Persian date fields |
long |
getJulianDay()
Get the Julian day corresponding to the date of this calendar. |
java.lang.String |
getPersianMonthName()
Gives the name of the current Persian month for this calendar's date. |
static java.lang.String |
getPersianMonthName(int month)
Gives the name of the specified Persian month. |
java.lang.String |
getPersianWeekDayName()
Gives the Persian name of the current day of the week for this calendar's date. |
static java.lang.String |
getPersianWeekDayName(int weekDay)
Gives the Persian name of the specified day of week. |
void |
setDateFields(DateFields dateFields)
Sets the date of this calendar object to the specified Persian date fields |
void |
setDateFields(int year,
int month,
int day)
Sets the date of this calendar object to the specified Persian date (year, month, and day fields) |
void |
setJulianDay(long julianDay)
Set the date of this calendar to the specified Julian day. |
Methods inherited from class java.util.GregorianCalendar |
---|
add, clone, equals, getActualMaximum, getActualMinimum, getGreatestMinimum, getGregorianChange, getLeastMaximum, getMaximum, getMinimum, getTimeZone, hashCode, isLeapYear, roll, roll, setGregorianChange, setTimeZone |
Methods inherited from class java.util.Calendar |
---|
after, before, clear, clear, compareTo, get, getAvailableLocales, getFirstDayOfWeek, getInstance, getInstance, getInstance, getInstance, getMinimalDaysInFirstWeek, getTime, getTimeInMillis, isLenient, isSet, set, set, set, set, setFirstDayOfWeek, setLenient, setMinimalDaysInFirstWeek, setTime, setTimeInMillis, toString |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Field Detail |
---|
public static final java.lang.String[] persianMonths
public static final java.lang.String[] persianWeekDays
Constructor Detail |
---|
public SimplePersianCalendar()
Method Detail |
---|
public long getJulianDay()
public void setJulianDay(long julianDay)
julianDay
- the desired Julian day to be set as the date of this calendar.public void setDateFields(int year, int month, int day)
year
- the Persian year.month
- the Persian month (zero-based).day
- the Persian day of month.public void setDateFields(DateFields dateFields)
dateFields
- the Persian date fields.public DateFields getDateFields()
public static java.lang.String getPersianMonthName(int month)
month
- the Persian month (zero-based).
public java.lang.String getPersianMonthName()
public static java.lang.String getPersianWeekDayName(int weekDay)
weekDay
- the day of week (use symbolic constants in the java.util.Calendar
class).
public java.lang.String getPersianWeekDayName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |