com.autonomy.utilities
Class DateManager

java.lang.Object
  |
  +--com.autonomy.utilities.DateManager

public class DateManager
extends java.lang.Object

This class takes a java Calendar object as input, and outputs the day, month and year so that

will return a string of the form:

regardless of which of the two getYear/getMonth/getDay methods are used This is done to cache the many on-the-fly String<->int conversions the search panes do on these dates.


Constructor Summary
DateManager(java.util.Calendar cInput)
          Constuctor.
 
Method Summary
 int getDay()
          Return the day of month for this calendar as an int
 java.lang.String getDay(int nLength)
          return the day of the month for this calendar as a string
 int getMonth()
          Return the month of year for this calendar as an int
 java.lang.String getMonth(int nLength)
          return the day of the month for this calendar as a string
 int getYear()
          Return the year for this calendar as an int
 java.lang.String getYear(int nLength)
          return the year for this calendar as a string
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DateManager

public DateManager(java.util.Calendar cInput)
Constuctor.

Parameters:
cInput - Calendar instance from which date information is to be extracted
Method Detail

getDay

public java.lang.String getDay(int nLength)
return the day of the month for this calendar as a string

Parameters:
nLength - length of returned String, which will be filled with leading zeros if it is too short. For example, on the 1st of the month:
    dm.getDay(2);

will return 01.
Returns:
String value of day

getMonth

public java.lang.String getMonth(int nLength)
return the day of the month for this calendar as a string

Parameters:
nLength - length of returned String, which will be filled with leading zeros if it is too short. For example, if the month is January:
    dm.getMonth(2);

will return 01.
Returns:
String value of month, as a number between 1 and 12

getYear

public java.lang.String getYear(int nLength)
return the year for this calendar as a string

Parameters:
nLength - length of returned String, which will be filled with leading zeros if it is too short. For example, if the year is 2002:
    dm.getYear(4);

will return 2002. Note that :
    dm.getYear(2);

will also return 2002, ie the return value cannot be trimmed.
Returns:
String value of year

getDay

public int getDay()
Return the day of month for this calendar as an int


getMonth

public int getMonth()
Return the month of year for this calendar as an int


getYear

public int getYear()
Return the year for this calendar as an int