| java.lang.Object net.sourceforge.squirrel_sql.fw.util.ThreadSafeDateFormat
ThreadSafeDateFormat | public class ThreadSafeDateFormat (Code) | | Maintains a single reference to a DateFormat and synchronizes access to
methods that delegate to it's methods of the same name.
|
Method Summary | |
public synchronized String | format(Object obj) Formats an object to produce a string. | public synchronized Date | parse(String str) Parses text from the beginning of the given string to produce a date.
The method may not use the entire text of the given string.
See the
ThreadSafeDateFormat.parse(String,ParsePosition) method for more information
on date parsing.
Parameters: source - A String whose beginning should be parsed. | public synchronized void | setLenient(boolean lenient) Specify whether or not date/time parsing is to be lenient. |
ThreadSafeDateFormat | public ThreadSafeDateFormat(DateFormat dateFormat)(Code) | | Constructor
Parameters: dateFormat - the DateFormat instance to protect. |
ThreadSafeDateFormat | public ThreadSafeDateFormat(int style)(Code) | | Constructor
Parameters: style - the given formatting style. For example,SHORT for "M/d/yy" in the US locale. |
ThreadSafeDateFormat | public ThreadSafeDateFormat(int style, boolean isTime)(Code) | | Constructor
Parameters: style - the given formatting style. For example,SHORT for "M/d/yy" in the US locale if isTime is false, and SHORT for "h:mm a" in the US locale if isTime is true |
ThreadSafeDateFormat | public ThreadSafeDateFormat(int dateSytle, int timeStyle)(Code) | | Constructor
Parameters: dateStyle - the given date formatting style. For example,SHORT for "M/d/yy" in the US locale. Parameters: timeStyle - the given time formatting style. For example,SHORT for "h:mm a" in the US locale. |
parse | public synchronized Date parse(String str) throws ParseException(Code) | | Parses text from the beginning of the given string to produce a date.
The method may not use the entire text of the given string.
See the
ThreadSafeDateFormat.parse(String,ParsePosition) method for more information
on date parsing.
Parameters: source - A String whose beginning should be parsed. A Date parsed from the string. exception: ParseException - if the beginning of the specified stringcannot be parsed. |
setLenient | public synchronized void setLenient(boolean lenient)(Code) | | Specify whether or not date/time parsing is to be lenient. With
lenient parsing, the parser may use heuristics to interpret inputs that
do not precisely match this object's format. With strict parsing,
inputs must match this object's format.
Parameters: lenient - when true, parsing is lenient See Also: java.util.Calendar.setLenient |
|
|