|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectrsvp.model.SimpleDate
public class SimpleDate
SimpleDate is a very simple representation of a calendar date and time. Notably, it only represents dates in the Gregorian calendar system (with American English month names) and does not account for separate time zones. However, it does validate that the date and time it stores are actually possible, given the Gregorian calendar and a 24-hour clock. (It will, however, be inaccurate for dates from before the introduction of the Gregorian calendar.)
Field Summary | |
---|---|
static long |
serialVersionUID
|
Constructor Summary | |
---|---|
SimpleDate(int month,
int day,
int year,
int hour,
int minute)
Constructs a SimpleDate with the given time values. |
Method Summary | |
---|---|
java.lang.String |
dateToString()
Returns a string representation of the date. |
int |
getDay()
|
int |
getHour()
|
int |
getMinute()
|
int |
getMonth()
|
int |
getYear()
|
boolean |
isValid()
Returns true if this SimpleDate is valid -- that is, does this SimpleDate correspond to a legitimate date in the Gregorian calendar? -- and false otherwise. |
void |
setDay(int day)
|
void |
setHour(int hour)
|
void |
setMinute(int minute)
|
void |
setMonth(int month)
|
void |
setYear(int year)
|
java.lang.String |
timeToString()
Returns a string representation of the time. |
java.lang.String |
toString()
Returns a string representation of the date and time. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final long serialVersionUID
Constructor Detail |
---|
public SimpleDate(int month, int day, int year, int hour, int minute)
month
- a month, between 1 and 12, inclusiveday
- a day number, between 1 and the number of days in the given month and yearyear
- a year numberhour
- an hour, between 0 and 23minute
- a minute, between 0 and 59Method Detail |
---|
public boolean isValid()
public int getDay()
public int getHour()
public int getMinute()
public int getMonth()
public int getYear()
public void setDay(int day)
public void setHour(int hour)
public void setMinute(int minute)
public void setMonth(int month)
public void setYear(int year)
public java.lang.String timeToString()
public java.lang.String dateToString()
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 |