public class PlainDate extends DataObject implements IDate, Intable, Value, LocaleFormatted
| Modifier and Type | Field and Description |
|---|---|
int |
day
The day in the month value, starting from 1.
|
int |
month
The month in the year value, starting from 1.
|
int |
year
The full four-digit year, e.g. 2008
|
| Constructor and Description |
|---|
PlainDate()
Constructs a PlainDate object set to the current date.
|
PlainDate(int day,
int month,
int year) |
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Object other)
Compare this object with another.
|
boolean |
dateIsValid()
Checks if month and day are both greater than 0.
|
void |
format(LocaleFormat locale,
CharArray dest) |
String |
format(String format)
Format the PlainDate using the LocaleFormat.format() method.
|
CharArray |
format(String format,
Locale locale,
CharArray dest) |
void |
fromString(char[] src,
int offset,
int length) |
void |
fromString(String s) |
PlainDate |
getDate(PlainDate dest) |
int |
getInt()
Convert this PlainDate into a platform independent int value.
|
int |
hashCode()
Returns a hashCode for the object.
|
void |
makeDateInvalid()
Set both the month and day to zero.
|
void |
parse(LocaleFormat localeFormat,
char[] chars,
int offset,
int length) |
void |
parse(String toParse,
String format)
Parse the PlainDate using the LocaleFormat.parse() method.
|
void |
setDate(int day,
int month,
int year) |
void |
setInt(int value)
Retrieve this PlainDate from a platform independent int value.
|
PlainDate |
setToCurrent()
Set the PlainDate to the current date.
|
String |
toString()
Return a String representation of this object.
|
CharArray |
toString(CharArray dest) |
_getFieldType, _getSetField, cache, copied, copyFrom, equals, getCopy, getDeclaredField, getDeclaredFieldValue, getMyFieldList, getNewpublic int year
public int month
public int day
public PlainDate()
public PlainDate(int day,
int month,
int year)
public String format(String format)
public void parse(String toParse, String format) throws ParseException
toParse - the String to parse.format - the expected format.ParseException - if the format is wrong.public PlainDate setToCurrent()
public boolean dateIsValid()
dateIsValid in interface IDatepublic void makeDateInvalid()
makeDateInvalid in interface IDatepublic int getInt()
public void setInt(int value)
public int compareTo(Object other)
ComparablecompareTo in interface ComparablecompareTo in class DataObjectpublic int hashCode()
Objectpublic String toString()
ObjecttoString in interface StringabletoString in class Objectpublic void fromString(String s)
fromString in interface Stringablepublic void fromString(char[] src,
int offset,
int length)
fromString in interface Stringablepublic CharArray toString(CharArray dest)
toString in interface Stringablepublic void format(LocaleFormat locale, CharArray dest)
format in interface LocaleFormattedpublic void parse(LocaleFormat localeFormat, char[] chars, int offset, int length) throws ParseException
parse in interface LocaleFormattedParseException