|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.klg.jclass.util.calendar.JCCalendar
For use in conjunction with a standard java.util.Calendar.
This component allows storage of special dates and then will
match a given Calendar
object to those dates.
Nested Class Summary | |
static class |
JCCalendar.DateMonthYear
Class to store a DateMonthYear value. |
static class |
JCCalendar.DayOfWeek
Class to store a day of the week. |
static class |
JCCalendar.MonthDayOfMonth
Class to store Month and Day of Month. |
class |
JCCalendar.MonthWeekDayOfWeek
Class to store a Month, Week, and Day of Week. |
Field Summary | |
protected static byte[][] |
daytable
|
protected Vector |
specialDates
|
Constructor Summary | |
JCCalendar()
|
Method Summary | |
void |
addSpecialDate(com.klg.jclass.util.calendar.SpecialDate sd)
Adds a special day given a date, month and year. |
static Object |
convertCalendarToObject(Calendar from,
Class classType)
Converts the Calendar object to an object designed by the class_type, if its one of the supported class types. |
static Calendar |
convertObjectToCalendar(Object obj,
Locale l)
Converts the specified type (if possible) to a supported type. |
static Calendar |
copyCalendar(Calendar cal)
Convenience method to clone a calendar. |
static int |
dayOfWeek(int date,
int month,
int year)
Calculates the day of week given the date, month, and year. |
static int |
daysInMonth(int month,
int year)
Calculates the number of days in a given month. |
static String[] |
getDays(Locale l)
Gets the list of short week day names for a given locale. |
static String[] |
getMonths(Locale l,
boolean isShort)
Gets the list of short or long month names for a given locale. |
protected int |
isInSpecialDateList(int year,
int month,
int date,
int week)
Returns the index in the specialDays vector if the object is
in the list. |
static boolean |
isLeapYear(int year)
Checks to see if the year is a leap year. |
boolean |
isSpecialDate(Calendar c)
Determines is a specified date is a special date. |
boolean |
isSpecialDate(int year,
int month,
int date,
int week)
Determines if a specified date is a special date. |
protected static String[] |
processArray(String[] input)
Processes array for empty or null Strings and returns a new array with them stripped out. |
void |
removeSpecialDate(com.klg.jclass.util.calendar.SpecialDate sd)
Removes a special day given a date, month, and year. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Vector specialDates
protected static final byte[][] daytable
Constructor Detail |
public JCCalendar()
Method Detail |
public static boolean isLeapYear(int year)
year
- the year to check
public static int dayOfWeek(int date, int month, int year)
date
- the day of the monthmonth
- the month (0 to 11)year
- the year to use (for example, 1997)
public static int daysInMonth(int month, int year)
year
- the year to use (for example, 1997)month
- the month (0 to 11)
protected static String[] processArray(String[] input)
input
- the input array to be checked
public static String[] getDays(Locale l)
l
- the locale for which the day names are required
public static String[] getMonths(Locale l, boolean isShort)
l
- the locale for which the month names are requiredisShort
- if true
, returns the short month names
public void addSpecialDate(com.klg.jclass.util.calendar.SpecialDate sd)
sd
- the SpecialDate
to addJCCalendar.DateMonthYear
,
JCCalendar.DayOfWeek
,
JCCalendar.MonthDayOfMonth
,
JCCalendar.MonthWeekDayOfWeek
,
removeSpecialDate(com.klg.jclass.util.calendar.SpecialDate)
public void removeSpecialDate(com.klg.jclass.util.calendar.SpecialDate sd)
sd
- the SpecialDate
to removeJCCalendar.DateMonthYear
,
JCCalendar.DayOfWeek
,
JCCalendar.MonthDayOfMonth
,
JCCalendar.MonthWeekDayOfWeek
,
addSpecialDate(com.klg.jclass.util.calendar.SpecialDate)
public boolean isSpecialDate(int year, int month, int date, int week)
year
- the year to use (for example, 1997)month
- the month (0 to 11)date
- the day of the monthweek
- the week of the month
true
if the date specified has been designated as
specialpublic boolean isSpecialDate(Calendar c)
c
- the Calendar
object which contains the specified date
true
if the date specified has been designated as
specialprotected int isInSpecialDateList(int year, int month, int date, int week)
specialDays
vector if the object is
in the list. Otherwise, it returns -1.
year
- the year to use (for example, 1997)month
- the month (0 to 11)date
- the day of the monthweek
- the week of the month
specialDays
vector if the object is in
the list; otherwise, it returns -1public static Calendar copyCalendar(Calendar cal)
cal
- the calendar object to clone
public static Calendar convertObjectToCalendar(Object obj, Locale l)
convertCalendarToSupported()
method.
The supported types are java.util.Date, java.util.Calendar,
java.util.GregorianCalendar, java.sql.Time, java.sql.Timestamp, and
java.sql.Date.
obj
- The supported object to convert to Calendar.l
- The locale to use
convertCalendarToObject(java.util.Calendar, java.lang.Class)
public static Object convertCalendarToObject(Calendar from, Class classType)
from
- The Calendar object to convert.classType
- The supported type to which the Calendar object is
converted. If the type is unsupported, null will be returned. The supported
types are java.util.Date, java.util.Calendar, java.util.GregorianCalendar,
java.sql.Time, java.sql.Timestamp, and java.sql.Date.
convertObjectToCalendar(java.lang.Object, java.util.Locale)
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |