|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.calendardate.CalendarDateFormat
Formats and parses CalendarDates in a locale-sensitive manner based on a
pattern string.
For example for a date representing June 12, 2004:
The pattern and format rules are the same as for java.text.SimpleDateFormat, except that only the following pattern letters are useful:
Letter Date Component Examples G
Era designator AD
y
Year 1996
;96
M
Month in year July
;Jul
;07
d
Day in month 10
E
Day in week Tuesday
;Tue
SimpleDateFormat
Constructor Summary | |
CalendarDateFormat(java.text.SimpleDateFormat format)
Creates a format object based on the given simple date format. |
|
CalendarDateFormat(java.lang.String pattern)
Creates a format object based on the given date pattern. |
Method Summary | |
java.lang.String |
format(CalendarDate date)
Creates a text-based representation of the given date |
CalendarDate |
parse(java.lang.String source)
Parses the given string to produce a CalendarDate. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public CalendarDateFormat(java.lang.String pattern)
pattern
- the pattern string - see class doc for more information
java.lang.IllegalArgumentException
- if the given pattern is invalidpublic CalendarDateFormat(java.text.SimpleDateFormat format)
Method Detail |
public java.lang.String format(CalendarDate date)
date
- The date to be formatted
public CalendarDate parse(java.lang.String source) throws java.text.ParseException
source
- The text to parse
java.text.ParseException
- If one of the following this true:
source
is outside the
valid CalendarDate range
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |