@ThreadSafe @Singleton public final class DateTimeFormatterCache extends AbstractNotifyingCache<DateTimeFormatterPattern,DateTimeFormatter>
DateTimeFormatter instances. It
caches up to a limited number of compiled DateTimeFormatter objects.| Modifier and Type | Field and Description |
|---|---|
static int |
MAX_CACHE_SIZE
The default number of items to keep in the cache
|
m_aCacheAccessStats, m_aRWLock, STATISTICS_PREFIX| Modifier and Type | Method and Description |
|---|---|
static DateTimeFormatter |
getDateTimeFormatter(String sPattern,
ResolverStyle eResolverStyle)
Get the cached DateTimeFormatter using the provided resolver style.
|
static DateTimeFormatter |
getDateTimeFormatterLenient(String sPattern)
Get the cached DateTimeFormatter using LENIENT resolving.
|
static DateTimeFormatter |
getDateTimeFormatterSmart(String sPattern)
Get the cached DateTimeFormatter using SMART resolving.
|
static DateTimeFormatter |
getDateTimeFormatterStrict(String sPattern)
Get the cached DateTimeFormatter using STRICT resolving.
|
static DateTimeFormatterCache |
getInstance() |
protected DateTimeFormatter |
getValueToCache(DateTimeFormatterPattern aPattern)
This abstract method is invoked, once a new value needs to be put into the
cache.
|
static boolean |
isInstantiated() |
getFromCacheclearCache, createCache, getFromCacheNoStats, getFromCacheNoStatsNotLocked, getFromCacheNotLocked, getMaxSize, getName, getSize, hasMaxSize, isEmpty, isNotEmpty, putInCache, putInCacheNotLocked, removeFromCache, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetComparatorCollating, getComparatorNamepublic static final int MAX_CACHE_SIZE
public static boolean isInstantiated()
@Nonnull public static DateTimeFormatterCache getInstance()
@Nonnull @IsLocked(value=WRITE) protected DateTimeFormatter getValueToCache(@Nonnull DateTimeFormatterPattern aPattern)
AbstractNotifyingCachegetValueToCache in class AbstractNotifyingCache<DateTimeFormatterPattern,DateTimeFormatter>aPattern - The key for which the value to cache is required. May be
nullable or not - depends upon the implementation.null.@Nonnull public static DateTimeFormatter getDateTimeFormatterStrict(@Nonnull @Nonempty String sPattern)
sPattern - The pattern to retrieve. May neither be null nor empty.null .IllegalArgumentException - If the pattern is invalid@Nonnull public static DateTimeFormatter getDateTimeFormatterSmart(@Nonnull @Nonempty String sPattern)
sPattern - The pattern to retrieve. May neither be null nor empty.null .IllegalArgumentException - If the pattern is invalid@Nonnull public static DateTimeFormatter getDateTimeFormatterLenient(@Nonnull @Nonempty String sPattern)
sPattern - The pattern to retrieve. May neither be null nor empty.null .IllegalArgumentException - If the pattern is invalid@Nonnull public static DateTimeFormatter getDateTimeFormatter(@Nonnull @Nonempty String sPattern, @Nonnull ResolverStyle eResolverStyle)
sPattern - The pattern to retrieve. May neither be null nor empty.eResolverStyle - The resolver style to be used. May not be null.null.IllegalArgumentException - If the pattern is invalidCopyright © 2014–2016 Philip Helger. All rights reserved.