Class CalendarLabeler

java.lang.Object
  extended by CalendarLabeler

public class CalendarLabeler
extends java.lang.Object

Generates labels for Calendar information. Assumes that Sunday is considered the first day of the week. Month counts from 0 to 11, while day of week counts from 1 to 7. This is consistent with the implementation in Calendar and GregorianCalendar classes. Consequently constants from Calendar class, e.g. Calendar.SUNDAY and Calendar.APRIL, can be used with this class.


Field Summary
static int MAX_DAY_OF_WEEK
           
static int MAX_MONTH_OF_YEAR
           
static int MIN_DAY_OF_WEEK
           
static int MIN_MONTH_OF_YEAR
           
 
Constructor Summary
CalendarLabeler()
           
 
Method Summary
static java.lang.String getDayOfWeekLabel(int dayOfWeek)
          Converts day of week value to text label
static java.lang.String getMonthOfYearLabel(int monthOfYear)
          Converts month number to text label
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIN_DAY_OF_WEEK

public static final int MIN_DAY_OF_WEEK
See Also:
Constant Field Values

MAX_DAY_OF_WEEK

public static final int MAX_DAY_OF_WEEK
See Also:
Constant Field Values

MIN_MONTH_OF_YEAR

public static final int MIN_MONTH_OF_YEAR
See Also:
Constant Field Values

MAX_MONTH_OF_YEAR

public static final int MAX_MONTH_OF_YEAR
See Also:
Constant Field Values
Constructor Detail

CalendarLabeler

public CalendarLabeler()
Method Detail

getDayOfWeekLabel

public static java.lang.String getDayOfWeekLabel(int dayOfWeek)
                                          throws java.lang.IllegalArgumentException
Converts day of week value to text label

Parameters:
dayOfWeek - the day of week number, Sunday: 1 , Monday: 2, ... , Saturday: 7
Returns:
corresponding text label, Sunday, ..., Saturday
Throws:
java.lang.IllegalArgumentException

getMonthOfYearLabel

public static java.lang.String getMonthOfYearLabel(int monthOfYear)
                                            throws java.lang.IllegalArgumentException
Converts month number to text label

Parameters:
monthOfYear - the day of week number, January: 0, ... , December: 11
Returns:
corresponding text label, January, ... , December
Throws:
java.lang.IllegalArgumentException

main

public static void main(java.lang.String[] args)