org.sakaiproject.util
Class CalendarUtil

java.lang.Object
  extended byorg.sakaiproject.util.CalendarUtil

public class CalendarUtil
extends Object

CalendarUtil is a bunch of utility methods added to a java Calendar object.

Version:
$Revision: 5839 $
Author:
University of Michigan, CHEF Software Development Team

Constructor Summary
CalendarUtil()
          Construct.
 
Method Summary
 int getDay_Of_Week()
          Get the day of the week.
 int getDayOfMonth()
          Get the day of month.
 int getDayOfWeekInMonth()
          Get the day of the week in month.
 int getFirstDayOfMonth(int month)
          Set the calendar to the first day of this month, and return this day of week.
 int getMonthInteger()
          Get the month as an int value.
 String getNextDate()
          Set the calendar to the next day, and return this.
 int getNextMonth()
          Set the calendar to the next month, and return this.
 int getNumberOfDays()
          Get the number of days.
 String getPrevDate()
          Set the calendar to the prev day, and return this.
 int getPrevMonth()
          Set the calendar to the prev month, and return this.
 String getTodayDate()
          Get the current date, formatted.
 int getWeekOfMonth()
          Get the week of month.
 int getYear()
          Access the current user.
 void nextDate()
           
 void prevDate()
           
 void setDay(int year, int month, int day)
          Set the calendar to this day.
 void setDayOfMonth(int d)
          Set the calendar to this day.
 void setMonth(int d)
          Set the calendar to this month
 void setNextWeek()
          Set the calendar to the next week, and return this.
 void setNextYear()
          Set the calendar to the next year, and return this.
 void setPrevWeek()
          Set the calendar to the prev week, and return this.
 void setPrevYear()
          Set the calendar to the prev year, and return this.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CalendarUtil

public CalendarUtil()
Construct.

Method Detail

getYear

public int getYear()
Access the current user.

Returns:
the current year.

getNextDate

public String getNextDate()
Set the calendar to the next day, and return this.

Returns:
the next day.

nextDate

public void nextDate()

getPrevDate

public String getPrevDate()
Set the calendar to the prev day, and return this.

Returns:
the prev day.

prevDate

public void prevDate()

getNextMonth

public int getNextMonth()
Set the calendar to the next month, and return this.

Returns:
the next month.

setNextYear

public void setNextYear()
Set the calendar to the next year, and return this.

Returns:
the next year.

getPrevMonth

public int getPrevMonth()
Set the calendar to the prev month, and return this.

Returns:
the prev month.

setPrevYear

public void setPrevYear()
Set the calendar to the prev year, and return this.

Returns:
the prev year.

getDay_Of_Week

public int getDay_Of_Week()
Get the day of the week.

Returns:
the day of the week.

setNextWeek

public void setNextWeek()
Set the calendar to the next week, and return this.

Returns:
the next week.

setPrevWeek

public void setPrevWeek()
Set the calendar to the prev week, and return this.

Returns:
the prev week.

getDayOfWeekInMonth

public int getDayOfWeekInMonth()
Get the day of the week in month.

Returns:
the day of week in month.

getWeekOfMonth

public int getWeekOfMonth()
Get the week of month.

Returns:
the week of month.

getMonthInteger

public int getMonthInteger()
Get the month as an int value.

Returns:
the month as an int value.

getDayOfMonth

public int getDayOfMonth()
Get the day of month.

Returns:
the day of month.

getTodayDate

public String getTodayDate()
Get the current date, formatted.

Returns:
the current date, formatted.

getNumberOfDays

public int getNumberOfDays()
Get the number of days.

Returns:
the number of days.

setDayOfMonth

public void setDayOfMonth(int d)
Set the calendar to this day.

Parameters:
d - the day.

setMonth

public void setMonth(int d)
Set the calendar to this month

Parameters:
d - the month.

getFirstDayOfMonth

public int getFirstDayOfMonth(int month)
Set the calendar to the first day of this month, and return this day of week.

Parameters:
month - The month.
Returns:
The calendar's day of week once set to this month.

setDay

public void setDay(int year,
                   int month,
                   int day)
Set the calendar to this day.

Parameters:
year - The year.
month - The month.
day - The day.