|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--java.util.Calendar
|
+--java.util.GregorianCalendar
|
+--com.raj.extensions.ExtendedGCalendar
Justs adds a few utility methods to the Calendar class that should have been there in the first place.
| Field Summary |
| Fields inherited from class java.util.GregorianCalendar |
AD, BC |
| Fields inherited from class java.util.Calendar |
AM, AM_PM, APRIL, areFieldsSet, AUGUST, DATE, DAY_OF_MONTH, DAY_OF_WEEK, DAY_OF_WEEK_IN_MONTH, DAY_OF_YEAR, DECEMBER, DST_OFFSET, ERA, FEBRUARY, FIELD_COUNT, fields, FRIDAY, HOUR, HOUR_OF_DAY, isSet, isTimeSet, JANUARY, JULY, JUNE, MARCH, MAY, MILLISECOND, MINUTE, MONDAY, MONTH, NOVEMBER, OCTOBER, PM, SATURDAY, SECOND, SEPTEMBER, SUNDAY, THURSDAY, time, TUESDAY, UNDECIMBER, WEDNESDAY, WEEK_OF_MONTH, WEEK_OF_YEAR, YEAR, ZONE_OFFSET |
| Constructor Summary | |
ExtendedGCalendar()
default constructor, sets up a new calendar for today |
|
ExtendedGCalendar(int year,
int month,
int date)
contstructor that sets the date of this object |
|
| Method Summary | |
int |
daysBetween(java.util.Calendar theDate)
calculates how many days that there are between this and the
given parameter, inclusive, where the order of the dates doesn't matter. |
int |
daysBetween(java.util.Calendar theDate,
boolean precedesMatters)
calculates how many days that there are between this and the
given parameter, inclusive.
|
int |
daysInMonth()
returns the number of days in the date represented by this object |
int |
daysInMonth(int month)
returns the number of days in the given month combination, assuming that this is not a leapyear |
int |
daysInMonth(int month,
int year)
returns the number of days in the given month/year combination |
java.lang.String |
getDateString()
Returns the date of this ExtendedGCalendar object in international standard date format -- YYYY-MMM-DD |
java.lang.String |
nameOfMonth(int month)
takes an integer from 0 to 11 and returns the month associated with that number, 0= January, 1= February etc |
| Methods inherited from class java.util.GregorianCalendar |
add, computeFields, computeTime, equals, getActualMaximum, getActualMinimum, getGreatestMinimum, getGregorianChange, getLeastMaximum, getMaximum, getMinimum, hashCode, isLeapYear, roll, roll, setGregorianChange |
| Methods inherited from class java.util.Calendar |
after, before, clear, clear, clone, complete, get, getAvailableLocales, getFirstDayOfWeek, getInstance, getInstance, getInstance, getInstance, getMinimalDaysInFirstWeek, getTime, getTimeInMillis, getTimeZone, internalGet, isLenient, isSet, set, set, set, set, setFirstDayOfWeek, setLenient, setMinimalDaysInFirstWeek, setTime, setTimeInMillis, setTimeZone, toString |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
public ExtendedGCalendar()
public ExtendedGCalendar(int year,
int month,
int date)
year - the year of the date that we wantmonth - the month of the date that we want (0 -- 11)date - the date of the month of the date that we want| Method Detail |
public java.lang.String nameOfMonth(int month)
month - the month number that you want a name for
public int daysInMonth()
this object
public int daysInMonth(int month,
int year)
month - the month that you want to find the num of days foryear - needed for leapyear calculations
public int daysInMonth(int month)
month - the month that you want to find the num of days for
daysInMonth(int month, int year)
public int daysBetween(java.util.Calendar theDate,
boolean precedesMatters)
this and the
given parameter, inclusive.
Note: I don't think that this is fully debugged yet! Use at your own risk!!
precedesMatters - if this is true, then it will check to make sure that
this precedes the parameter, and if it does not, then it returns -1
this and the given parameter.
If this does not precede the given parameter when
precedesMatters is true, then -1 is returned.public int daysBetween(java.util.Calendar theDate)
this and the
given parameter, inclusive, where the order of the dates doesn't matter.
public java.lang.String getDateString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||