|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectEasyDate
public class EasyDate
Field Summary | |
---|---|
static long |
MILLIS_DAY
Number of milliseconds in 24 hours. |
Constructor Summary | |
---|---|
EasyDate()
Constructs a date for the current month, day, and year. |
|
EasyDate(EasyDate other)
Constructs a date equal to a given date. |
|
EasyDate(int month,
int day,
int year)
Constructs a date for given month, day, and year. |
Method Summary | |
---|---|
EasyDate |
add(int numDays)
Returns a new EasyDate that is numDays later
than this date (or earlier, if numDays is negative). |
int |
compareTo(EasyDate other)
Compares this date to other . |
int |
daysTo(EasyDate other)
Returns the number of days from this date to other . |
boolean |
equals(java.lang.Object obj)
Checks whether this date id equal to other . |
int |
getDay()
Returns the day of this EasyDate. |
int |
getMonth()
Returns the month of this EasyDate. |
int |
getYear()
Returns the year of this EasyDate. |
static boolean |
isLeapYear(int year)
Checks whether a given year is a leap year. |
java.lang.String |
toString()
Returns this date as a string in the mm/dd/yyyy format. |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final long MILLIS_DAY
Constructor Detail |
---|
public EasyDate()
public EasyDate(int month, int day, int year)
month
- the month (1 - 12)day
- the day (1 - 31)year
- the year (1600 - 2100)public EasyDate(EasyDate other)
other
- the date to be copied.Method Detail |
---|
public static boolean isLeapYear(int year)
year
- a year to be checked (1600-2100).
year
is a leap year, false otherwise.public int getMonth()
public int getDay()
public int getYear()
public EasyDate add(int numDays)
numDays
later
than this date (or earlier, if numDays is negative).
public int daysTo(EasyDate other)
other
.
public int compareTo(EasyDate other)
this
date to other
.
compareTo
in interface java.lang.Comparable<EasyDate>
this
date is later than other; returns a negative integer if this
date is earlier than other
; returns 0 if this
date is the same as other
.public boolean equals(java.lang.Object obj)
this
date id equal to other
.
equals
in class java.lang.Object
obj
represents the same date as
this
, false otherwise.public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |