|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectformatter.Date
public class Date
Stores the year, month, date (day of the month), and day (name of the day of
the week). The distinction between the "date" and the "day" are that the
date is a number from 1 to 31 and is relative to the month, whereas the day
is a String that correlates to the day within the week, e.g.
"Tuesday" and "Friday".
| Constructor Summary | |
|---|---|
Date(int y,
int m,
int dt)
Stores the date represented by the year, month, and date parameters. |
|
Date(int y,
int m,
int dt,
java.lang.String dy)
Stores the date represented by the year, month, and date parameters. |
|
| Method Summary | |
|---|---|
boolean |
after(Date that)
Determines if this date is after the passed date. |
boolean |
before(Date that)
Determines if this date is before the passed date. |
static java.lang.String |
dayToFullName(java.lang.String day)
Converts the smaller section of a day-of-the-week's name to the full section. |
boolean |
equals(Date that)
Determines if the passed date object is equivalent to this one. |
boolean |
equals(java.lang.Object that)
Determines if the passed date object is equivalent to this one. |
int |
getDate()
Returns the day of the month. |
java.lang.String |
getDay()
Returns the day of the week. |
int |
getMonth()
Returns the month of th year, e.g. |
int |
getYear()
Returns the year. |
static int |
monthToInt(java.lang.String month)
Returns the number corresponding to the month in the year. |
java.lang.String |
toString()
Returns a String representation of this Date. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Date(int y,
int m,
int dt)
y - Year of the date.m - Month of the date.dt - Date of the date -- the day-portion.
public Date(int y,
int m,
int dt,
java.lang.String dy)
y - Year of the date.m - Month of the date.dt - Date of the date -- the day-portion.dy - The day of the week.| Method Detail |
|---|
public static java.lang.String dayToFullName(java.lang.String day)
day - The beginning of the day of the week. Must be at least 2 characters.
java.lang.IllegalArgumentException - If the parameter is not a day of the week.public static int monthToInt(java.lang.String month)
month - The name of the month. Must be at least 3 characters long.
java.lang.IllegalArgumentException - If the string is not a valid month.public int getYear()
public int getMonth()
public int getDate()
public java.lang.String getDay()
public java.lang.String toString()
String representation of this Date.
toString in class java.lang.ObjectString representation.public boolean equals(java.lang.Object that)
equals in class java.lang.Objectthat - The other date to compare this with.
true if the dates are the same
and false otherwise.public boolean equals(Date that)
that - The other date to compare this with.
true if the dates are the same
and false otherwise.public boolean after(Date that)
that - The Date to compare against.
public boolean before(Date that)
that - The Date to compare against.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||