Compoze Software, Inc.

portlets.compoze.groupware.calendar
Class Month

java.lang.Object
  extended byportlets.compoze.groupware.calendar.Month
All Implemented Interfaces:
java.io.Serializable

public class Month
extends java.lang.Object
implements java.io.Serializable

This class represents a month for display.

See Also:
Serialized Form

Nested Class Summary
static class Month.Day
          This inner class represents a day in the month.
static class Month.Item
          This inner class represents an item in the month.
static class Month.Week
          This inner class represents a week in the month.
 
Constructor Summary
Month(java.util.Date givenDate)
          Constructor using the default locale and time zone.
Month(java.util.Locale locale, java.util.TimeZone timeZone)
          Constructor.
Month(java.util.Locale locale, java.util.TimeZone timeZone, java.util.Date givenDate)
          Constructor.
 
Method Summary
 void dumpMonth()
          Dumps the month to System.out.
 java.util.Calendar getCalendar()
          Gets a calendar based on the month locale and time zone.
 java.lang.String getDay(int iDay, int iFieldWidth)
          Gets the localized string for the day.
 java.lang.String getDay(int iDay, int iFieldWidth, java.util.Locale locale)
          Gets the localized string for the day.
 java.util.Date getEndDate()
          Gets the end date.
 java.lang.String getEndDayOfWeek()
          Gets the localized string for the end day of week.
 java.lang.String getEndDayOfWeek(int iFieldWidth)
          Gets the localized string for the end day of week.
 java.util.Date getGivenDate()
          Gets the given date.
 Month.Item[] getHeader()
          Gets the header.
 int getMonth()
          Gets the month.
 java.util.Date getMonthEndDate()
          Gets the month end date.
 java.util.Date getMonthStartDate()
          Gets the month start date.
 java.lang.String getMonthString()
          Gets the localized string for the month given date.
 java.lang.String getMonthString(java.util.Locale locale)
          Gets the localized string for the month given date.
 java.util.Date getNextMonthDate()
          Gets the next month date.
 java.util.Date getPreviousMonthDate()
          Gets the previous month date.
 java.util.Date getStartDate()
          Gets the start date.
 java.lang.String getStartDayOfWeek()
          Gets the localized string for the start day of week.
 java.lang.String getStartDayOfWeek(int iFieldWidth)
          Gets the localized string for the start day of week.
 Month.Week getWeek(int iWeekIndex)
          Gets the week by index.
 int getWeekCount()
          Gets the number of weeks.
 int getYear()
          Gets the year.
 java.lang.String getYearString()
          Gets the localized string for the year.
 java.lang.String getYearString(java.util.Locale locale)
          Gets the localized string for the year.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Month

public Month(java.util.Date givenDate)
Constructor using the default locale and time zone.

Parameters:
givenDate - the given date (may not be null)

Month

public Month(java.util.Locale locale,
             java.util.TimeZone timeZone)
Constructor.

Parameters:
locale - the locale (may not be null)
timeZone - the time zone (may not be null)

Month

public Month(java.util.Locale locale,
             java.util.TimeZone timeZone,
             java.util.Date givenDate)
Constructor.

Parameters:
locale - the locale (may not be null)
timeZone - the time zone (may not be null)
givenDate - the given date (may not be null)
Method Detail

getCalendar

public java.util.Calendar getCalendar()
Gets a calendar based on the month locale and time zone.

Returns:
the calendar

getWeekCount

public int getWeekCount()
Gets the number of weeks.

Returns:
the number of weeks

getPreviousMonthDate

public java.util.Date getPreviousMonthDate()
Gets the previous month date.

Returns:
the previous month date

getNextMonthDate

public java.util.Date getNextMonthDate()
Gets the next month date.

Returns:
the next month date

getGivenDate

public java.util.Date getGivenDate()
Gets the given date.

Returns:
the given date

getMonth

public int getMonth()
Gets the month.

Returns:
the month (1=January)

getMonthString

public java.lang.String getMonthString()
Gets the localized string for the month given date.

Returns:
the localized string for the month

getMonthString

public java.lang.String getMonthString(java.util.Locale locale)
Gets the localized string for the month given date.

Parameters:
locale - the locale (may not be null)
Returns:
the localized string for the month

getYear

public int getYear()
Gets the year.

Returns:
the year

getYearString

public java.lang.String getYearString()
Gets the localized string for the year.

Returns:
the localized string for the year

getYearString

public java.lang.String getYearString(java.util.Locale locale)
Gets the localized string for the year.

Parameters:
locale - the locale (may not be null)
Returns:
the localized string for the year

getHeader

public Month.Item[] getHeader()
Gets the header.

Returns:
an array of items as the header

getWeek

public Month.Week getWeek(int iWeekIndex)
Gets the week by index.

Parameters:
iWeekIndex - the week index (0=first week)
Returns:
the week
See Also:
getWeekCount()

getMonthStartDate

public java.util.Date getMonthStartDate()
Gets the month start date.

Returns:
the month start date

getMonthEndDate

public java.util.Date getMonthEndDate()
Gets the month end date.

Returns:
the month end date

getStartDate

public java.util.Date getStartDate()
Gets the start date.

Returns:
the start date

getEndDate

public java.util.Date getEndDate()
Gets the end date.

Returns:
the end date

getStartDayOfWeek

public java.lang.String getStartDayOfWeek()
Gets the localized string for the start day of week.

Returns:
the localized string for the start day of week

getStartDayOfWeek

public java.lang.String getStartDayOfWeek(int iFieldWidth)
Gets the localized string for the start day of week.

Parameters:
iFieldWidth - the width of day field
Returns:
the localized string for the start day of week

getEndDayOfWeek

public java.lang.String getEndDayOfWeek()
Gets the localized string for the end day of week.

Returns:
the localized string for the end day of week

getEndDayOfWeek

public java.lang.String getEndDayOfWeek(int iFieldWidth)
Gets the localized string for the end day of week.

Parameters:
iFieldWidth - the width of day field
Returns:
the localized string for the end day of week

getDay

public java.lang.String getDay(int iDay,
                               int iFieldWidth)
Gets the localized string for the day.

Parameters:
iDay - the day (1=Sunday)
iFieldWidth - the width of day field
Returns:
the localized string for the day

getDay

public java.lang.String getDay(int iDay,
                               int iFieldWidth,
                               java.util.Locale locale)
Gets the localized string for the day.

Parameters:
iDay - the day (1=Sunday)
iFieldWidth - the width of day field
locale - the locale (may not be null)
Returns:
the localized string for the day

dumpMonth

public void dumpMonth()
Dumps the month to System.out.


Compoze Software, Inc.

Copyright ©1999-2003 Compoze Software, Inc. All rights reserved.