com.ds.fw.types.data
Class FwCalendar

java.lang.Object
  |
  +--com.ds.fw.types.data.FwCalendar

public class FwCalendar
extends java.lang.Object


Field Summary
 java.util.Calendar calendar
           
static java.lang.String[] DAY_NAMES
          An array containing the names of the days in a week
static int[] DAYS_IN_MONTH
          An array containing the number of the days in the month
static java.lang.String[] SHORT_DAY_NAMES
          An array containing the short names of the days in a week
 
Constructor Summary
FwCalendar()
           
 
Method Summary
 void addDay(int i)
          Adds to the current day a number of days
 void addMonth(int i)
          Adds to the current month a number of months
 java.util.Date getDate()
          Gets the date
 int getDay()
          Return the day of the month as number, starting from 1
 int getDayOfWeek()
          Gets the day of a week
 int getDayOfWeek(int i)
           
 java.lang.String getDayOfWeekName()
          Gets the name of a day
 int getDaysInMonth()
          Returns the days in the month
static int getDaysInMonth(int mm, int yy)
          Gets the days in a month
 int getMonth()
          Gets the number of the month
 int getYear()
          Gets the year
static boolean isLeapYear(int yy)
          Check if the year , given as parameter is a leap year
 boolean isValid(int yy, int mm)
           
 boolean isValid(int yy, int mm, int dd)
           
 void setDate(java.util.Date d)
          Sets the date
 void setDate(int yy, int mm, int dd)
          Sets the date
 void setDay(int i)
          Sets a day in the month
 void setMonth(int mm)
          Sets the number of the month
 void setYear(int yy)
          Sets the year
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DAYS_IN_MONTH

public static int[] DAYS_IN_MONTH
An array containing the number of the days in the month


SHORT_DAY_NAMES

public static java.lang.String[] SHORT_DAY_NAMES
An array containing the short names of the days in a week


DAY_NAMES

public static java.lang.String[] DAY_NAMES
An array containing the names of the days in a week


calendar

public java.util.Calendar calendar
Constructor Detail

FwCalendar

public FwCalendar()
Method Detail

getDaysInMonth

public static int getDaysInMonth(int mm,
                                 int yy)
Gets the days in a month

Parameters:
mm - - the month
yy - - the year
Returns:
a number of the days in a month

isLeapYear

public static boolean isLeapYear(int yy)
Check if the year , given as parameter is a leap year

Parameters:
yy - - the year
Returns:
true if it is a leap year , false - otherwise

getDay

public int getDay()
Return the day of the month as number, starting from 1

Returns:
the number of the day in the month

setDay

public void setDay(int i)
Sets a day in the month

Parameters:
i - - the number of the new day

getMonth

public int getMonth()
Gets the number of the month

Returns:
the month

setMonth

public void setMonth(int mm)
Sets the number of the month

Parameters:
mm - - the new month

getYear

public int getYear()
Gets the year

Returns:
the year

setYear

public void setYear(int yy)
Sets the year

Parameters:
yy - - the new year

getDate

public java.util.Date getDate()
Gets the date

Returns:
the date

setDate

public void setDate(java.util.Date d)
Sets the date

Parameters:
d - - the new date

setDate

public void setDate(int yy,
                    int mm,
                    int dd)
Sets the date

Parameters:
yy - - the year
mm - - the month
dd - - the day

getDaysInMonth

public int getDaysInMonth()
Returns the days in the month

Returns:

getDayOfWeek

public int getDayOfWeek(int i)

getDayOfWeek

public int getDayOfWeek()
Gets the day of a week

Returns:
the day of the week

getDayOfWeekName

public java.lang.String getDayOfWeekName()
Gets the name of a day

Returns:
the name of a week day

addDay

public void addDay(int i)
Adds to the current day a number of days

Parameters:
i - - the number of days that must be added

addMonth

public void addMonth(int i)
Adds to the current month a number of months

Parameters:
i - - the number of months that must be added

isValid

public boolean isValid(int yy,
                       int mm,
                       int dd)

isValid

public boolean isValid(int yy,
                       int mm)