com.codahale.metrics.MetricFilter
public class WildCardMetricFilter extends Object implements com.codahale.metrics.MetricFilter
Constructor | Description |
---|---|
WildCardMetricFilter(List<String> whiteList) |
Creates a new wild card metrics filter.
|
Modifier and Type | Method | Description |
---|---|---|
static Collection<String> |
getMatches(String t,
String p) |
Simple computation of the longest common extension (LCE) of two
given strings, beginning at two given indices.
|
List<String> |
getWhiteList() |
Returns the white list.
|
static int |
longestCommonExtension(String t1,
int i1,
String t2,
int i2) |
This method takes four parameters: t1 and t2 (the two strings) and
two indices i1 and i2 (the index to start at in t1 and t2).
|
boolean |
matches(String name,
com.codahale.metrics.Metric metric) |
|
boolean |
matchesAny() |
Returns
true if the filter will match no metric. |
boolean |
matchesNone() |
Returns
true if the filter will match any metric. |
public WildCardMetricFilter(List<String> whiteList)
whiteList
- The white list entries, null
if none.public List<String> getWhiteList()
null
if none.public boolean matchesNone()
true
if the filter will match any metric.true
if any metric will be matched, else
false
.public boolean matchesAny()
true
if the filter will match no metric.true
if no metric will be matched, else
false
.public boolean matches(String name, com.codahale.metrics.Metric metric)
matches
in interface com.codahale.metrics.MetricFilter
public static int longestCommonExtension(String t1, int i1, String t2, int i2)
public static Collection<String> getMatches(String t, String p)
References: Gusfield, Dan (1999), Algorithms on Strings, Sequences and Trees, Cambridge: University Press.
An implementation of string matching with wildcards, as described in Gusfield 1999:199. When used with a longest common extension computation with suffix trees, it allows for searching a pattern with k wildcards in a text T of length m in O(km) time (Gusfield 1999:199). This implementation uses a simple computation of the longest common extension.
Copyright © 2018 Connect2id. All rights reserved.