|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectealet.Calendar
public class Calendar
Ethiopian calendar generator including monthly, annual, and moving holidays. It is limited to CE (Common Era); that is, from 00. The calendar calculation, religious and national holidays system is based on Dr. Getatchew Haile's book "Bahra Hassab" published in 2000.
This class can be used for these specific tasks.
Calendar cal = new Calendar(year) ;
Day day = Calendar.toGregorian(month, date, year) ;
Day day = Calendar.toEthiopian(month, date, year) ;
--------- --------- --------- Year | Sep |---| Oct |---| Nov |--- ... --------- --------- --------- + + + | | | | | | --------- --------- --------- ------------- Day | Mon | | Tue | | Thu |---| holiday |.... --------- --------- --------- ------------- . . . . . . . . .Some important terms:
Constructor Summary | |
---|---|
Calendar(int year)
Constructor: A linked-list for months is constructed. |
Method Summary | |
---|---|
static java.lang.String |
getDay(int month,
int date,
int ce)
Returns the day of the given date. |
static int |
getEthiopianDayIndex(int month,
int date,
int year)
Determines what the day is for a given Ethiopian date. |
java.util.LinkedList[] |
getEthiopianGregorianCalendar()
This method generates the calendar for the requested year. |
java.lang.String |
getGregorianDay(int ce,
int month,
int date)
Returns the day of a given Gregorian date |
int |
getMetqee(int ce)
Returns the metqee for the given year |
java.lang.String |
getNewYearDay(int ce)
Returns the Ethiopian new year day which will be used as starting day for the given year |
void |
insertAnnualHoliday()
The method prepares annual holidays with integer array. |
void |
insertMonthlyHoliday()
It prepares monthly holidays with integer array. |
void |
insertMovingHolidays()
Fasting holidays are variables since they are calcualted based on moon's epect. |
static Day |
toEthiopian(int month,
int date,
int year)
The method performs conversion from Gregorian date to Ethiopian. |
static Day |
toGregorian(int month,
int date,
int year)
The method performs conversion from Ethiopian date to Gregorian. |
static int |
whenIsEthNewYearInGregSeptember(int year)
Ethiopian new year occurs either on Gregorian September 11/12. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Calendar(int year)
year
- the year to which a calendar will be builtMethod Detail |
---|
public int getMetqee(int ce)
ce
- a year for which metqee is generated
public java.lang.String getNewYearDay(int ce)
ce
- A year for which metqee is generated
public static java.lang.String getDay(int month, int date, int ce)
month
- Ethiopian monthdate
- Ethiopian datece
- Ethiopian Common Era year
public void insertMonthlyHoliday()
The properties file is "ealet_holiday_properties.xml" and has the following form.
The key and values ares
1 abo ^ ^ key value ^ ^ | | | ----- the name of the holiday | ----- the date of the month to the holiday belongs
public void insertAnnualHoliday()
The properties file is "ealet_holiday_properties.xml" and has the following field and value content.
The key and values ares
1-1 Enkutatash ^ ^ key value ^ ^ | | | ----- the name of the holiday | ----- the 1st is month while the 2nd is date
public void insertMovingHolidays()
As each fasting holiday is calculated, an instance of the Day class is created and inserted into the calendar under each proper month and date. This method must be called after the main calendar is built; that is. after the calendarYear linked list is completely built. Failing to do so will result fatal error.
public java.lang.String getGregorianDay(int ce, int month, int date)
month
- Gregorian calendar monthdate
- Gregorian calendar datece
- Gregorian calendar year
public static int whenIsEthNewYearInGregSeptember(int year)
year
- Ethiopian year
public static Day toGregorian(int month, int date, int year)
month
- Ethiopian calendar monthdate
- Ethiopian calendar dateyear
- Ethiopian calendar year
public static Day toEthiopian(int month, int date, int year)
month
- Gregorian calendar monthdate
- Gregorian calendar dateyear
- Gregorian calendar year
public static int getEthiopianDayIndex(int month, int date, int year)
month
- Ethiopian monthdate
- Ethiopian dateyear
- Ethiopian year
public java.util.LinkedList[] getEthiopianGregorianCalendar()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |