public class CachedCrnStringPatternMatcher<T> extends Object
We assume that the number of unique subjects that we'll route based on is not unreasonably large. There may be, eg. tens of thousands of topics, but not billions. We use an LRU to make sure we don't expand the cache indefinitely.
Modifier and Type | Class and Description |
---|---|
static class |
CachedCrnStringPatternMatcher.Builder<T> |
Constructor and Description |
---|
CachedCrnStringPatternMatcher(CrnPatternMatcher<T> matcher,
int capacity)
Create a cache with the desired capacity.
|
Modifier and Type | Method and Description |
---|---|
static <T> CachedCrnStringPatternMatcher.Builder<T> |
builder() |
T |
match(String crnString)
Return the stored value for this CRN, or null if there is no match
|
int |
size() |
String |
toString() |
public CachedCrnStringPatternMatcher(CrnPatternMatcher<T> matcher, int capacity)