public static final class Date.Value extends Object implements Cloneable
Constructor and Description |
---|
Date.Value(Calendar calendar)
Constructs a new date value based on the specified
Calendar . |
Date.Value(Date date)
Constructs a new date value based on the specified
java.util.Date object. |
Date.Value(int year,
int month,
int day)
Constructs a new date value.
|
Date.Value(long millis)
Constructs a new date value based on the specified number of
milliseconds since the UNIX Epoch.
|
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Creates and returns a copy of this object.
|
boolean |
equals(Object obj) |
int |
getDayOfMonth()
Returns the day of the month.
|
int |
getMonthOfYear()
Returns the month of the year.
|
int |
getYear()
Returns the year.
|
int |
hashCode() |
Date |
toDate()
Converts to a
java.util.Date object. |
String |
toString()
Returns a textual representation of this object.
|
public Date.Value(int year, int month, int day)
year
- the year, e.g. 2005
.month
- the month of the year, e.g. 11
for November.day
- the day of the month, e.g. 1
for the first day of the
month.public Date.Value(Calendar calendar) throws IllegalArgumentException
Calendar
.calendar
- the Calendar
object to get the exact date from, cannot be
null
.IllegalArgumentException
- if calendar == null
.public Date.Value(Date date) throws IllegalArgumentException
java.util.Date
object.date
- the Date
object to get the exact date from,
cannot be null
.IllegalArgumentException
- if date == null
.public Date.Value(long millis) throws IllegalArgumentException
millis
- the number of milliseconds since the
UNIX Epoch.IllegalArgumentException
- if millis < 0L
.System.currentTimeMillis()
public Object clone()
clone
in class Object
null
.Object.clone()
public int getYear()
public int getMonthOfYear()
public int getDayOfMonth()
public Date toDate()
java.util.Date
object.Date
corresponding to this value.See http://www.xins.org/.