org.kde.koala
Class KCalendarSystem

java.lang.Object
  extended by org.kde.koala.KCalendarSystem
All Implemented Interfaces:
org.kde.qt.QtSupport

public class KCalendarSystem
extends java.lang.Object
implements org.kde.qt.QtSupport

CalendarSystem abstract class, default derived kde gregorian class and factory class. Provides support for different calendar types for kde calendar widget and related stuff. Derived classes must be created through KCalendarFactory class

Author:
Carlos Moro

Constructor Summary
protected KCalendarSystem(java.lang.Class dummy)
           
 
Method Summary
 java.util.Calendar addDays(java.util.Calendar date, int ndays)
          Returns a Calendar object containing a date ndays later.
 java.util.Calendar addMonths(java.util.Calendar date, int nmonths)
          Returns a Calendar object containing a date nmonths later.
 java.util.Calendar addYears(java.util.Calendar date, int nyears)
          Returns a Calendar object containing a date nyears later.
 java.lang.String calendarName()
          Gets the string representing the calendar
 int day(java.util.Calendar date)
          Gets specific calendar type day number of month for a given date
 int dayOfWeek(java.util.Calendar date)
          Gets specific calendar type number of day of week number for a given date
 int dayOfYear(java.util.Calendar date)
          Gets specific calendar type day number of year for a given date
 int daysInMonth(java.util.Calendar date)
          Gets specific calendar type number of days in month for a given date
 int daysInYear(java.util.Calendar date)
          Gets the number of days in date whose years specified.
 java.lang.String dayString(java.util.Calendar pDate, boolean bShort)
          Converts a date into a day literal
 int dayStringToInteger(java.lang.String sNum, int[] iLength)
          Converts a day literal of a part of a string into a integer starting at the beginning of the string
 boolean isLunar()
          Gets if the calendar is lunar based
 boolean isLunisolar()
          Gets if the calendar is lunisolar based
 boolean isSolar()
          Gets if the calendar is solar based
 int maxValidYear()
          Gets the maximum year value supported by specific calendar type algorithms (Calendar, 8000)
 int minValidYear()
          Gets the first year value supported by specific calendar type algorithms.
 int month(java.util.Calendar date)
          Gets specific calendar type month for a given gregorian date
 java.lang.String monthName(java.util.Calendar date)
           
 java.lang.String monthName(java.util.Calendar date, boolean shortName)
          Gets specific calendar type month name for a given gregorian date
 java.lang.String monthName(int month, int year)
           
 java.lang.String monthName(int month, int year, boolean shortName)
          Gets specific calendar type month name for a given month number If an invalid month is specified, null is returned.
 java.lang.String monthNamePossessive(java.util.Calendar date)
           
 java.lang.String monthNamePossessive(java.util.Calendar date, boolean shortName)
          Returns a string containing the possessive form of the month name.
 java.lang.String monthNamePossessive(int month, int year)
           
 java.lang.String monthNamePossessive(int month, int year, boolean shortName)
          Returns a string containing the possessive form of the month name.
 int monthsInYear(java.util.Calendar date)
          Gets specific calendar type number of month for a given year
 java.lang.String monthString(java.util.Calendar pDate, boolean bShort)
          Converts a date into a month literal
 int monthStringToInteger(java.lang.String sNum, int[] iLength)
          Converts a month literal of a part of a string into a integer starting at the beginning of the string
 boolean setYMD(java.util.Calendar date, int y, int m, int d)
          Changes the date's year, month and day.
 java.lang.String weekDayName(java.util.Calendar date)
           
 java.lang.String weekDayName(java.util.Calendar date, boolean shortName)
          Gets specific calendar type week day name
 java.lang.String weekDayName(int weekDay)
           
 java.lang.String weekDayName(int weekDay, boolean shortName)
          Gets specific calendar type week day name If an invalid week day is specified, null is returned.
 int weekDayOfPray()
          Gets the day of the week traditionaly associated with pray
 int weekNumber(java.util.Calendar date)
           
 int weekNumber(java.util.Calendar date, int[] yearNum)
          Gets specific calendar type week number for a given date
 int weeksInYear(int year)
          Gets the number of weeks in a specified year
 int year(java.util.Calendar date)
          Gets specific calendar type year for a given gregorian date
 java.lang.String yearString(java.util.Calendar pDate, boolean bShort)
          Converts a date into a year literal
 int yearStringToInteger(java.lang.String sNum, int[] iLength)
          Converts a year literal of a part of a string into a integer starting at the beginning of the string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KCalendarSystem

protected KCalendarSystem(java.lang.Class dummy)
Method Detail

year

public int year(java.util.Calendar date)
Gets specific calendar type year for a given gregorian date

Parameters:
date - gregorian date
Returns:
year

yearString

public java.lang.String yearString(java.util.Calendar pDate,
                                   boolean bShort)
Converts a date into a year literal

Parameters:
pDate - The date to convert
bShort - If the short version of should be used
Returns:
The year literal of the date

yearStringToInteger

public int yearStringToInteger(java.lang.String sNum,
                               int[] iLength)
Converts a year literal of a part of a string into a integer starting at the beginning of the string

Parameters:
sNum - The string to parse
iLength - The number of chars used, and 0 if no valid symbols was found in the string
Returns:
An integer corresponding to the year

month

public int month(java.util.Calendar date)
Gets specific calendar type month for a given gregorian date

Parameters:
date - gregorian date
Returns:
month number

monthString

public java.lang.String monthString(java.util.Calendar pDate,
                                    boolean bShort)
Converts a date into a month literal

Parameters:
pDate - The date to convert
bShort - If the short version of should be used
Returns:
The month literal of the date

monthStringToInteger

public int monthStringToInteger(java.lang.String sNum,
                                int[] iLength)
Converts a month literal of a part of a string into a integer starting at the beginning of the string

Parameters:
sNum - The string to parse
iLength - The number of chars used, and 0 if no valid symbols was found in the string
Returns:
An integer corresponding to the month

day

public int day(java.util.Calendar date)
Gets specific calendar type day number of month for a given date

Parameters:
date - gregorian date equivalent to the specific one
Returns:
day of the month

dayString

public java.lang.String dayString(java.util.Calendar pDate,
                                  boolean bShort)
Converts a date into a day literal

Parameters:
pDate - The date to convert
bShort - If the short version of should be used
Returns:
The day literal of the date

dayStringToInteger

public int dayStringToInteger(java.lang.String sNum,
                              int[] iLength)
Converts a day literal of a part of a string into a integer starting at the beginning of the string

Parameters:
sNum - The string to parse
iLength - The number of chars used, and 0 if no valid symbols was found in the string
Returns:
An integer corresponding to the day

dayOfWeek

public int dayOfWeek(java.util.Calendar date)
Gets specific calendar type number of day of week number for a given date

Parameters:
date - gregorian date
Returns:
day of week

dayOfYear

public int dayOfYear(java.util.Calendar date)
Gets specific calendar type day number of year for a given date

Parameters:
date - gregorian date equivalent to the specific one
Returns:
day number

setYMD

public boolean setYMD(java.util.Calendar date,
                      int y,
                      int m,
                      int d)
Changes the date's year, month and day. The range of the year, month and day depends on which calendar is being used.

Parameters:
date - Date to change
y - Year
m - Month number
d - Day of month
Returns:
true if the date is valid; otherwise returns false.

addYears

public java.util.Calendar addYears(java.util.Calendar date,
                                   int nyears)
Returns a Calendar object containing a date nyears later.

Parameters:
date - The old date
nyears - The number of years to add
Returns:
The new date

addMonths

public java.util.Calendar addMonths(java.util.Calendar date,
                                    int nmonths)
Returns a Calendar object containing a date nmonths later.

Parameters:
date - The old date
nmonths - The number of months to add
Returns:
The new date

addDays

public java.util.Calendar addDays(java.util.Calendar date,
                                  int ndays)
Returns a Calendar object containing a date ndays later.

Parameters:
date - The old date
ndays - The number of days to add
Returns:
The new date

monthsInYear

public int monthsInYear(java.util.Calendar date)
Gets specific calendar type number of month for a given year

Parameters:
date - The date whose year to use
Returns:
The number of months in that year

daysInYear

public int daysInYear(java.util.Calendar date)
Gets the number of days in date whose years specified.

Parameters:
date - Gregorian date equivalent to the specific one
Returns:
The number of days in year

daysInMonth

public int daysInMonth(java.util.Calendar date)
Gets specific calendar type number of days in month for a given date

Parameters:
date - gregorian date
Returns:
number of days for month in date

weeksInYear

public int weeksInYear(int year)
Gets the number of weeks in a specified year

Parameters:
year - the year
Returns:
number of weeks in year

weekNumber

public int weekNumber(java.util.Calendar date,
                      int[] yearNum)
Gets specific calendar type week number for a given date

Parameters:
date - gregorian date
yearNum - The year the date belongs to
Returns:
week number

weekNumber

public int weekNumber(java.util.Calendar date)

monthName

public java.lang.String monthName(int month,
                                  int year,
                                  boolean shortName)
Gets specific calendar type month name for a given month number If an invalid month is specified, null is returned.

Parameters:
month - The month number
year - The year the month belongs to
shortName - Specifies if the short month name should be used
Returns:
The name of the month

monthName

public java.lang.String monthName(int month,
                                  int year)

monthName

public java.lang.String monthName(java.util.Calendar date,
                                  boolean shortName)
Gets specific calendar type month name for a given gregorian date

Parameters:
date - Gregorian date
shortName - Specifies if the short month name should be used
Returns:
The name of the month

monthName

public java.lang.String monthName(java.util.Calendar date)

monthNamePossessive

public java.lang.String monthNamePossessive(int month,
                                            int year,
                                            boolean shortName)
Returns a string containing the possessive form of the month name. ("of January", "of February", etc.) It's needed in long format dates in some languages. If an invalid month is specified, null is returned.

Parameters:
month - The month number
year - The year the month belongs to
shortName - Specifies if the short month name should be used
Returns:
The possessive form of the name of the month

monthNamePossessive

public java.lang.String monthNamePossessive(int month,
                                            int year)

monthNamePossessive

public java.lang.String monthNamePossessive(java.util.Calendar date,
                                            boolean shortName)
Returns a string containing the possessive form of the month name. ("of January", "of February", etc.) It's needed in long format dates in some languages.

Parameters:
date - Gregorian date
shortName - Specifies if the short month name should be used
Returns:
The possessive form of the name of the month

monthNamePossessive

public java.lang.String monthNamePossessive(java.util.Calendar date)

weekDayName

public java.lang.String weekDayName(int weekDay,
                                    boolean shortName)
Gets specific calendar type week day name If an invalid week day is specified, null is returned.

Parameters:
weekDay - number of day in week (1 . Monday)
shortName - short or complete day name
Returns:
day name

weekDayName

public java.lang.String weekDayName(int weekDay)

weekDayName

public java.lang.String weekDayName(java.util.Calendar date,
                                    boolean shortName)
Gets specific calendar type week day name

Parameters:
date - the date
shortName - short or complete day name
Returns:
day name

weekDayName

public java.lang.String weekDayName(java.util.Calendar date)

minValidYear

public int minValidYear()
Gets the first year value supported by specific calendar type algorithms.

Returns:
first year supported

maxValidYear

public int maxValidYear()
Gets the maximum year value supported by specific calendar type algorithms (Calendar, 8000)

Returns:
maximum year supported

weekDayOfPray

public int weekDayOfPray()
Gets the day of the week traditionaly associated with pray

Returns:
day number

calendarName

public java.lang.String calendarName()
Gets the string representing the calendar


isLunar

public boolean isLunar()
Gets if the calendar is lunar based

Returns:
if the calendar is lunar based

isLunisolar

public boolean isLunisolar()
Gets if the calendar is lunisolar based

Returns:
if the calendar is lunisolar based

isSolar

public boolean isSolar()
Gets if the calendar is solar based

Returns:
if the calendar is solar based