com.devexperts.qd.util
Class ThreadSafeDateFormat
java.lang.Object
com.devexperts.qd.util.ThreadSafeDateFormat
public final class ThreadSafeDateFormat
- extends java.lang.Object
Thread-safe wrapper for DateFormat.
It delegates only format(Date date)
now,
so feel free to delegate additional methods if you need.
But do not change formats, if you don't want to get
different formatting in different threads.
Migrated from toscommon
Method Summary |
java.lang.String |
format(java.util.Date date)
|
java.text.DateFormat |
getFormat()
|
java.util.Date |
parse(java.lang.String source)
|
java.util.Date |
parse(java.lang.String source,
java.text.ParsePosition pos)
|
void |
setTimeZone(java.util.TimeZone zone)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ThreadSafeDateFormat
public ThreadSafeDateFormat(java.text.DateFormat source_format)
format
public java.lang.String format(java.util.Date date)
parse
public java.util.Date parse(java.lang.String source,
java.text.ParsePosition pos)
parse
public java.util.Date parse(java.lang.String source)
throws java.text.ParseException
- Throws:
java.text.ParseException
setTimeZone
public void setTimeZone(java.util.TimeZone zone)
getFormat
public java.text.DateFormat getFormat()