public class ThreadSafeSimpleDateFormat
extends java.lang.Object
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.
Constructor and Description |
---|
ThreadSafeSimpleDateFormat(java.lang.String format,
java.util.TimeZone timeZone,
int initialPoolSize,
int maxPoolSize,
boolean lenient) |
ThreadSafeSimpleDateFormat(java.lang.String format,
java.util.TimeZone timeZone,
java.util.Locale locale,
int initialPoolSize,
int maxPoolSize,
boolean lenient) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
format(java.util.Date date) |
java.util.Date |
parse(java.lang.String date) |
java.lang.String |
toString() |
public ThreadSafeSimpleDateFormat(java.lang.String format, java.util.TimeZone timeZone, int initialPoolSize, int maxPoolSize, boolean lenient)
public ThreadSafeSimpleDateFormat(java.lang.String format, java.util.TimeZone timeZone, java.util.Locale locale, int initialPoolSize, int maxPoolSize, boolean lenient)
Copyright © 2004–2023 XStream. All rights reserved.