|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
This interface is designed to provide a simplified subset of the
methods provided by the java.text.DateFormat
class.
This interface is necessary because of the difficulty in writing
thread safe classes that inherit from java.text.DateFormat
.
This difficulty leads us to approach the problem using composition
rather than inheritance. In general classes that implement this
interface will delegate these calls to an internal DateFormat object.
Method Summary | |
String |
format(Date d)
Formats a Date into a date/time string. |
TimeZone |
getTimeZone()
Gets the time zone. |
boolean |
isLenient()
Tell whether date/time parsing is to be lenient. |
Date |
parse(String source)
Parses text from the beginning of the given string to produce a date. |
void |
setLenient(boolean lenient)
Specify whether or not date/time parsing is to be lenient. |
void |
setTimeZone(TimeZone zone)
Sets the time zone of this SimplifiedDateFormat object. |
Method Detail |
public String format(Date d)
public Date parse(String source) throws ParseException
source
- A String
whose beginning should be parsed.
Date
parsed from the string.
ParseException
- if the beginning of the specified string
cannot be parsed.public void setTimeZone(TimeZone zone)
zone
- the given new time zone.public TimeZone getTimeZone()
public void setLenient(boolean lenient)
lenient
- when true, parsing is lenientCalendar.setLenient(boolean)
public boolean isLenient()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |