org.blojsom.plugin.calendar
Class BlogCalendar

java.lang.Object
  extended byorg.blojsom.plugin.calendar.BlogCalendar

public class BlogCalendar
extends java.lang.Object

BlogCalendar

Version:
$Id: BlogCalendar.java,v 1.7 2006/01/04 16:53:00 czarneckid Exp $
Author:
Mark Lussier

Constructor Summary
BlogCalendar(java.util.Calendar calendar, java.lang.String blogurl)
          Public Constructor
BlogCalendar(java.util.Calendar calendar, java.lang.String blogurl, java.util.Locale locale)
          Public Constructor
 
Method Summary
 boolean dayHasEntry(int dom)
          Determines if a day of the month has entries
 java.util.Calendar getCalendar()
          Get the Calendar instance
 java.lang.String getCalendarUrl()
          Get the Blog URL used by the calendar
 java.lang.String getCaption()
          Returns the current Month as MMMMM yyyy (ex: March 2003)
 int getCurrentDay()
          Gets the current day for this Calendar
 int getCurrentMonth()
          Gets the current month for this Calendar
 int getCurrentYear()
          Gets the current year for this Calendar
 java.lang.String getDayOfWeekName(int dow)
          Get the localized name of a Day of the Week
 java.lang.String[] getDayOfWeekNames()
          Get a lit of the day of the week names (localized)
 int getDaysInMonth()
          Returns the number of days in the current month
 java.lang.Boolean[] getEntryDates()
          Get the array of day of month entry flags
 int getFirstDayOfMonth()
          Returns the day of the week for the 1st of the month occurs on
 java.lang.String getMonthName(int month)
          Get the localized name of the given month
 java.lang.String[] getMonthNames()
          Get a list of the month names (localized)
 java.lang.String getRequestedDateKey()
          Gets the current entry date match key (year+month+day)
 java.lang.String getShortDayOfWeekName(int dow)
          Get the localized abbreviated name of a Day of the Week
 java.lang.String[] getShortDayOfWeekNames()
          Get a lit of the abbreviated day of the week names (localized)
 java.lang.String getShortMonthName(int month)
          Get the localized abbreviated name of the given month
 java.lang.String[] getShortMonthNames()
          Get a list of the abbreviated month names (localized)
 java.util.Calendar getToday()
          Get today as a Calendar instance
 void removeEntryForDOM(int dom)
          Flag a day in the current month as NOT having entries
 void setCurrentDay(int currentday)
          Sets the current day for this Calendar
 void setCurrentMonth(int currentmonth)
          Sets the current month for this Calendar
 void setCurrentYear(int currentyear)
          Sets the current year for this Calendar
 void setEntryForDOM(int dom)
          Flag a day in the current month as having entries
 void setRequestedDateKey(java.lang.String requestedDateKey)
          Sets the current entry date match key (year+month+day)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BlogCalendar

public BlogCalendar(java.util.Calendar calendar,
                    java.lang.String blogurl)
Public Constructor

Parameters:
calendar - Caledar instance
blogurl - The blog's url for calendar navigation

BlogCalendar

public BlogCalendar(java.util.Calendar calendar,
                    java.lang.String blogurl,
                    java.util.Locale locale)
Public Constructor

Parameters:
calendar - Caledar instance
blogurl - The blog's url for calendar navigation
locale - Locale for the Calendar
Method Detail

getCaption

public java.lang.String getCaption()
Returns the current Month as MMMMM yyyy (ex: March 2003)

Returns:
the current month and year as a string

getFirstDayOfMonth

public int getFirstDayOfMonth()
Returns the day of the week for the 1st of the month occurs on

Returns:
the day of the week for the 1st of the month as an int

getDaysInMonth

public int getDaysInMonth()
Returns the number of days in the current month

Returns:
days in this month

setEntryForDOM

public void setEntryForDOM(int dom)
Flag a day in the current month as having entries

Parameters:
dom - the day of the month

removeEntryForDOM

public void removeEntryForDOM(int dom)
Flag a day in the current month as NOT having entries

Parameters:
dom - the day of the month

dayHasEntry

public boolean dayHasEntry(int dom)
Determines if a day of the month has entries

Parameters:
dom - the day of the month
Returns:
a boolean indicating entries exist

getEntryDates

public java.lang.Boolean[] getEntryDates()
Get the array of day of month entry flags

Returns:
a boolean array of the months entries

getMonthName

public java.lang.String getMonthName(int month)
Get the localized name of the given month

Parameters:
month - the month (as defined by Calendar)
Returns:
the month as a localized string

getMonthNames

public java.lang.String[] getMonthNames()
Get a list of the month names (localized)

Returns:
String array of localized month names

getShortMonthName

public java.lang.String getShortMonthName(int month)
Get the localized abbreviated name of the given month

Parameters:
month - the month (as defined by Calendar)
Returns:
the abbreviated month as a localized string (ex: Feb)

getShortMonthNames

public java.lang.String[] getShortMonthNames()
Get a list of the abbreviated month names (localized)

Returns:
String array of localized abbreviated month names

getDayOfWeekName

public java.lang.String getDayOfWeekName(int dow)
Get the localized name of a Day of the Week

Parameters:
dow - the day of the week (as defined by Calendar)
Returns:
the day of the week as a localized string

getDayOfWeekNames

public java.lang.String[] getDayOfWeekNames()
Get a lit of the day of the week names (localized)

Returns:
String array of localized Day of Week names

getShortDayOfWeekName

public java.lang.String getShortDayOfWeekName(int dow)
Get the localized abbreviated name of a Day of the Week

Parameters:
dow - the day of the week (as defined by Calendar)
Returns:
the abbreviated day of the week as a localized string

getShortDayOfWeekNames

public java.lang.String[] getShortDayOfWeekNames()
Get a lit of the abbreviated day of the week names (localized)

Returns:
String array of localized abbreviated Day of Week names

getCalendarUrl

public java.lang.String getCalendarUrl()
Get the Blog URL used by the calendar

Returns:
the blog url

getCalendar

public java.util.Calendar getCalendar()
Get the Calendar instance

Returns:
Calendar instance

getToday

public java.util.Calendar getToday()
Get today as a Calendar instance

Returns:
Calendar instance

getCurrentMonth

public int getCurrentMonth()
Gets the current month for this Calendar

Returns:
current month as an int (as defined by Calendar)

setCurrentMonth

public void setCurrentMonth(int currentmonth)
Sets the current month for this Calendar

Parameters:
currentmonth - current month as an int (as defined by Calendar)

getCurrentYear

public int getCurrentYear()
Gets the current year for this Calendar

Returns:
current year as an int (as defined by Calendar)

setCurrentYear

public void setCurrentYear(int currentyear)
Sets the current year for this Calendar

Parameters:
currentyear - current year as an int (as defined by Calendar)

getCurrentDay

public int getCurrentDay()
Gets the current day for this Calendar

Returns:
current day as an int (as defined by Calendar)

setCurrentDay

public void setCurrentDay(int currentday)
Sets the current day for this Calendar

Parameters:
currentday - current day as an int (as defined by Calendar)

getRequestedDateKey

public java.lang.String getRequestedDateKey()
Gets the current entry date match key (year+month+day)

Returns:
Date match key as a String

setRequestedDateKey

public void setRequestedDateKey(java.lang.String requestedDateKey)
Sets the current entry date match key (year+month+day)

Parameters:
requestedDateKey - current entry match key