|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface SimplifiedDateFormat
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 | |
---|---|
java.lang.String |
format(java.util.Date d)
Formats a Date into a date/time string. |
java.util.TimeZone |
getTimeZone()
Gets the time zone. |
boolean |
isLenient()
Tell whether date/time parsing is to be lenient. |
java.util.Date |
parse(java.lang.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(java.util.TimeZone zone)
Sets the time zone of this SimplifiedDateFormat object. |
Method Detail |
---|
java.lang.String format(java.util.Date d)
date
- the time value to be formatted into a time string.
java.util.Date parse(java.lang.String source) throws java.text.ParseException
source
- A String
whose beginning should be parsed.
Date
parsed from the string.
java.text.ParseException
- if the beginning of the specified string
cannot be parsed.void setTimeZone(java.util.TimeZone zone)
zone
- the given new time zone.java.util.TimeZone getTimeZone()
void setLenient(boolean lenient)
lenient
- when true, parsing is lenientCalendar.setLenient(boolean)
boolean isLenient()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |