applicationLogic.utility
Class Date

java.lang.Object
  extended by applicationLogic.utility.Date

public class Date
extends java.lang.Object

This class has NO SEMANTIC CORRECTNESS CHECKING IN SETTORS/CONSTRUCTORS. Every time you wish to use a date from this class, check it for validity with checkDate().

Author:
03chowch

Field Summary
static int DAYINDEX
           
static int MAXDAYS
           
static int MAXMONTHS
           
static int MINYEAR
           
static int MONTHINDEX
           
static int YEARINDEX
           
 
Constructor Summary
Date(int year, int month, int day)
           
Date(java.lang.String date)
          Constructor for date
 
Method Summary
 boolean checkDate()
          Check whether if date is valid or not.
static int getCurrentYear()
           
 int getDay()
          Retrieve the day
 int getMonth()
          Retrieve the month
 int getYear()
          Retrieve the year
static java.lang.String monthToString(int month)
          Retrieve the corresponding month in String format.
 void setDay(int day)
          Setting the day
 void setMonth(int month)
          Setting the month
 void setYear(int year)
          Setting the year
 java.lang.String toString()
          Output date in format 'YYYY-MM-DD'
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

YEARINDEX

public static final int YEARINDEX
See Also:
Constant Field Values

MONTHINDEX

public static final int MONTHINDEX
See Also:
Constant Field Values

DAYINDEX

public static final int DAYINDEX
See Also:
Constant Field Values

MAXMONTHS

public static final int MAXMONTHS
See Also:
Constant Field Values

MAXDAYS

public static final int MAXDAYS
See Also:
Constant Field Values

MINYEAR

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

Date

public Date(int year,
            int month,
            int day)

Date

public Date(java.lang.String date)
Constructor for date

Parameters:
date - - in the format "YYYY-MM-DD"
Method Detail

getCurrentYear

public static int getCurrentYear()

checkDate

public boolean checkDate()
Check whether if date is valid or not.

Returns:

monthToString

public static java.lang.String monthToString(int month)
Retrieve the corresponding month in String format.

Parameters:
month - - the month in integer
Returns:

setYear

public void setYear(int year)
Setting the year

Parameters:
year -

setMonth

public void setMonth(int month)
Setting the month

Parameters:
month -

setDay

public void setDay(int day)
Setting the day

Parameters:
day -

getYear

public int getYear()
Retrieve the year

Returns:

getMonth

public int getMonth()
Retrieve the month

Returns:

getDay

public int getDay()
Retrieve the day

Returns:

toString

public java.lang.String toString()
Output date in format 'YYYY-MM-DD'

Overrides:
toString in class java.lang.Object