@ThreadSafe @Singleton public final class RegExCache extends AbstractNotifyingCache<RegExPattern,Pattern>
Pattern 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 RegExCache |
getInstance() |
static Pattern |
getPattern(String sRegEx)
Get the cached regular expression pattern.
|
static Pattern |
getPattern(String sRegEx,
int nOptions)
Get the cached regular expression pattern.
|
protected Pattern |
getValueToCache(RegExPattern aRegEx)
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 RegExCache getInstance()
@Nonnull @IsLocked(value=WRITE) protected Pattern getValueToCache(@Nonnull RegExPattern aRegEx)
AbstractNotifyingCachegetValueToCache in class AbstractNotifyingCache<RegExPattern,Pattern>aRegEx - The key for which the value to cache is required. May be
nullable or not - depends upon the implementation.null but should not be
null.@Nonnull public static Pattern getPattern(@Nonnull @Nonempty @RegEx String sRegEx)
sRegEx - The regular expression to retrieve. May neither be null
nor empty.null
.IllegalArgumentException - If the passed regular expression has an illegal syntax@Nonnull public static Pattern getPattern(@Nonnull @Nonempty @RegEx String sRegEx, @Nonnegative int nOptions)
sRegEx - The regular expression to retrieve. May neither be null
nor empty.nOptions - The options used for Pattern.compilenull
.IllegalArgumentException - If the passed regular expression has an illegal syntaxPattern.compile(String, int)Copyright © 2014–2017 Philip Helger. All rights reserved.