|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.moneydance.apps.md.model.time.MDDate
public final class MDDate
The MDDate
class is the Moneydance representation of a date. In essence, this is simply a day, month,
year instance. There is no time or time zone. This class also contains utility methods for comparing and computing
with dates.
Constructor Summary | |
---|---|
MDDate()
Create an MDDate for today. |
|
MDDate(java.util.Date date)
Create an MDDate from the given Date . |
|
MDDate(int value)
Create an MDDate from the given int representation. |
|
MDDate(int day,
int month,
int year)
Create an MDDate with the given day, month and year. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object o)
|
static MDDate |
fromString(java.lang.String string)
|
int |
hashCode()
|
boolean |
isAfter(MDDate date)
|
boolean |
isBefore(MDDate date)
|
static boolean |
isValidDate(int value)
Returns true if the given int is a valid date representation. |
java.util.Date |
toDate()
Returns this date as a Date with the time set to noon. |
int |
toInt()
Returns this date as an int where the integer value is an eight digit number with the digits put
together as YYYYMMDD. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MDDate()
MDDate
for today.
public MDDate(java.util.Date date)
MDDate
from the given Date
.
date
- a Date
public MDDate(int value) throws java.lang.IllegalArgumentException
MDDate
from the given int
representation.
value
- an int
representation of a date
java.lang.IllegalArgumentException
- if the given int
is not a valid datetoInt()
public MDDate(int day, int month, int year)
MDDate
with the given day, month and year. Unlike MDDate(int)
, this
constructor is lenient and will compute a valid date from the integer valus given. For example, the argument list
32,1,2000
would give an MDDate
with the value of Ferbuary 1st, 2000.
day
- a day value with 1 meaning the first of the monthmonth
- a month value with 1 meaning Januaryyear
- a year value taken as the exact value (ie not a two digit year 09 meaning 2009)Method Detail |
---|
public static boolean isValidDate(int value)
true
if the given int
is a valid date representation. The integer value must
have a valid day (1-31, depending on the month) in the tens/ones positions, a valid month (1-12) in the
thousands/hundreds positions and a valid year (greater than 1900) in the ten millions through ten thousands
positions.
value
- an int
representation of a date
true
if the given int
is a valid date representation.public int toInt()
int
where the integer value is an eight digit number with the digits put
together as YYYYMMDD.
int
public java.util.Date toDate()
Date
with the time set to noon.
Date
.public java.lang.String toString()
toString
in class java.lang.Object
public static MDDate fromString(java.lang.String string) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public boolean isBefore(MDDate date)
public boolean isAfter(MDDate date)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |