public class SuffixStringMatcher extends TrieStringMatcher
String
s against a set of
suffixes. Zero-length Strings
are ignored.TrieStringMatcher.TrieNode
root
Constructor and Description |
---|
SuffixStringMatcher(java.util.Collection<java.lang.String> suffixes)
Creates a new
PrefixStringMatcher which will match
String s with any suffix in the supplied
Collection |
SuffixStringMatcher(java.lang.String[] suffixes)
Creates a new
PrefixStringMatcher which will match
String s with any suffix in the supplied array. |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
longestMatch(java.lang.String input)
Returns the longest suffix of
input that is matched,
or null if no match exists. |
static void |
main(java.lang.String[] argv) |
boolean |
matches(java.lang.String input)
Returns true if the given
String is matched by a suffix in the
trie |
java.lang.String |
shortestMatch(java.lang.String input)
Returns the shortest suffix of
input that is matched,
or null if no match exists. |
addPatternBackward, addPatternForward, matchChar
public SuffixStringMatcher(java.lang.String[] suffixes)
PrefixStringMatcher
which will match
String
s with any suffix in the supplied array.public SuffixStringMatcher(java.util.Collection<java.lang.String> suffixes)
PrefixStringMatcher
which will match
String
s with any suffix in the supplied
Collection
public boolean matches(java.lang.String input)
String
is matched by a suffix in the
triematches
in class TrieStringMatcher
public java.lang.String shortestMatch(java.lang.String input)
input
that is matched,
or null
if no match exists.shortestMatch
in class TrieStringMatcher
public java.lang.String longestMatch(java.lang.String input)
input
that is matched,
or null
if no match exists.longestMatch
in class TrieStringMatcher
public static final void main(java.lang.String[] argv)
Copyright © 2019 The Apache Software Foundation