: Class Date

Class Date

java.lang.Object
  |
  +--Date

public class Date
extends java.lang.Object

keeps track of the date, provides methods for accessing and changing, incrementing and printing the date.


Field Summary
static int BASE_YEAR
          default value for the year attribute.
 
Constructor Summary
Date()
           
 
Method Summary
 boolean setDate(int day, int month, int year)
          Sets the date.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BASE_YEAR

public static final int BASE_YEAR
default value for the year attribute.
Constructor Detail

Date

public Date()
Method Detail

setDate

public boolean setDate(int day,
                       int month,
                       int year)
                throws LeapYearException
Sets the date. If one of the parameters is out of range the call has no effect.
Parameters:
day - The day in the month to be set (1-31).
month - The month to be set (1-12).
year - The year to be set (1900-2500).
Returns:
true if date was changed, false otherwise.
Throws:
LeapYearException - if the date is Feb. 29, and year is not a leap year..