|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.nakedobjects.applib.value.Magnitude
org.nakedobjects.applib.value.Date
public class Date
Value object representing a date (not time) value.
TODO: other methods to implement comparison methods:
| Constructor Summary | |
|---|---|
Date()
Create a Date object for today's date. |
|
Date(java.util.Date date)
Create a Date object based on the specified Java date object. |
|
Date(int year,
int month,
int day)
Create a Date object set to the specified day, month and year. |
|
| Method Summary | |
|---|---|
Date |
add(int years,
int months,
int days)
Add the specified days, years and months to this date value and return a new date object containing the result. |
protected Date |
createDate(java.util.Date time)
|
java.util.Date |
dateValue()
Return this date value as a Java Date object. |
Date |
endOfMonth()
Calculates, and returns, a date representing the last day of the month relative to the current date. |
boolean |
equals(java.lang.Object obj)
|
int |
getDay()
Return the day from this date, in the range 1 - 31. |
int |
getDayOfWeek()
Calculates, and returns, an int representing the day of the week relative to the current date. |
int |
getMonth()
Return the month from this date, in the range 1 - 12. |
int |
getYear()
Return the year from this date. |
boolean |
isEqualTo(Magnitude date)
Returns true if the date of this object has the same value as the specified date |
boolean |
isLessThan(Magnitude date)
Returns true if the time of this object is earlier than the specified time |
boolean |
sameDayOfMonthAs(Date as)
Determines if this date and the specified date represent the same day of the month, eg both dates are for the 3rd. |
boolean |
sameDayOfWeekAs(Date as)
Determines if this date and the specified date represent the same day of the week, eg both dates are on a Tuesday. |
boolean |
sameDayOfYearAs(Date as)
Determines if this date and the specified date represent the same day of the year, eg both dates are for the 108th day of the year. |
boolean |
sameMonthAs(Date as)
Determines if this date and the specified date represent the same month, eg both dates are for the March. |
boolean |
sameWeekAs(Date as)
Determines if this date and the specified date represent the same week in the year, eg both dates are the for the 18th week of the year. |
boolean |
sameYearAs(Date as)
Determines if this date and the specified date represent the same year. |
Date |
startOfMonth()
Calculates, and returns, a date representing the first day of the month relative to the current date. |
Date |
startOfWeek()
Calculates, and returns, a date representing the first day of the week relative to the current date. |
Date |
startOfYear()
Calculates, and returns, a date representing the first day of the year relative to the current date. |
java.lang.String |
title()
|
java.lang.String |
toString()
|
| Methods inherited from class org.nakedobjects.applib.value.Magnitude |
|---|
isBetween, isGreaterThan, isGreaterThanOrEqualTo, isLessThanOrEqualTo, max, min |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Date()
public Date(int year,
int month,
int day)
public Date(java.util.Date date)
| Method Detail |
|---|
protected Date createDate(java.util.Date time)
public Date add(int years,
int months,
int days)
public java.util.Date dateValue()
Datepublic Date endOfMonth()
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int getDay()
public int getDayOfWeek()
public int getMonth()
public int getYear()
public boolean isEqualTo(Magnitude date)
isEqualTo in class Magnitudepublic boolean isLessThan(Magnitude date)
isLessThan in class Magnitudepublic boolean sameDayOfMonthAs(Date as)
public boolean sameDayOfWeekAs(Date as)
public boolean sameDayOfYearAs(Date as)
public boolean sameMonthAs(Date as)
public boolean sameWeekAs(Date as)
public boolean sameYearAs(Date as)
public Date startOfMonth()
public Date startOfWeek()
public Date startOfYear()
public java.lang.String title()
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 | |||||||||