public class CachedCrnStringPatternMatcher<T>
extends java.lang.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(java.lang.String crnString)
Return the stored value for this CRN, or null if there is no match
|
int |
size() |
java.lang.String |
toString() |
public CachedCrnStringPatternMatcher(CrnPatternMatcher<T> matcher, int capacity)
public static <T> CachedCrnStringPatternMatcher.Builder<T> builder()
public T match(java.lang.String crnString)
public int size()
public java.lang.String toString()
toString
in class java.lang.Object