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