java.lang.ObjectDay
public class Day
Constructor Summary | |
---|---|
Day()
Constructs a day object representing today's date. |
|
Day(int aYear,
int aMonth,
int aDayOfMonth)
Constructs a day with a given year, month, and day of the Julian/Gregorian calendar. |
Method Summary | |
---|---|
void |
addDays(int numberOfDays)
Changes to a date that is a certain number of days away from the current date. |
int |
daysFrom(Day other)
Returns the number of days between this day and another day. |
int |
getDayOfMonth()
Returns the day of the month of this day. |
int |
getMonth()
Returns the month of this day. |
int |
getYear()
Returns the year of this day. |
java.lang.String |
toString()
|
Methods inherited from class |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Day()
public Day(int aYear, int aMonth, int aDayOfMonth)
aYear
- a year (any number other than 0)aMonth
- a month between 1 and 12aDayOfMonth
- a day of the month between 1 and 31Method Detail |
---|
public void addDays(int numberOfDays)
numberOfDays
- the number of days, can be negativepublic int daysFrom(Day other)
other
- the other day
other
)public int getDayOfMonth()
public int getMonth()
public int getYear()
public java.lang.String toString()
toString
in class java.lang.Object