SimpleDateFormat has a high overhead in creating and is not thread safe. To make best use of resources, the ThreadSafeSimpleDateFormat provides a dynamically sizing pool of instances, each of which will only be called by a single thread at a time.
The pool has a maximum capacity, to limit overhead. If all instances in the pool are in use and another is required, it shall block until one becomes available.
| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| private final Pool | |
| private final TimeZone |
| Access | Constructor and Description |
|---|---|
| public | ThreadSafeSimpleDateFormat(String format, TimeZone timeZone, int initialPoolSize, int maxPoolSize, final boolean lenient)
|
| public | ThreadSafeSimpleDateFormat(String format, TimeZone timeZone, final Locale locale, int initialPoolSize, int maxPoolSize, final boolean lenient)
|
| Modifier and Type | Method and Description |
|---|---|
| private DateFormat | |
| public String | |
| public Date | |
| public String |
| formatString | back to summary |
|---|---|
| private final String formatString | |
| pool | back to summary |
|---|---|
| private final Pool pool | |
| timeZone | back to summary |
|---|---|
| private final TimeZone timeZone | |
| ThreadSafeSimpleDateFormat | back to summary |
|---|---|
| public ThreadSafeSimpleDateFormat(String format, TimeZone timeZone, int initialPoolSize, int maxPoolSize, final boolean lenient) | |
| ThreadSafeSimpleDateFormat | back to summary |
|---|---|
| public ThreadSafeSimpleDateFormat(String format, TimeZone timeZone, final Locale locale, int initialPoolSize, int maxPoolSize, final boolean lenient) | |
| fetchFromPool | back to summary |
|---|---|
| private DateFormat fetchFromPool() | |
| format | back to summary |
|---|---|
| public String format(Date date) | |
| parse | back to summary |
|---|---|
| public Date parse(String date) throws ParseException | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
| |