public class SuffixStringMatcher extends TrieStringMatcher
Strings against a set
of suffixes. Zero-length Strings are ignored.TrieStringMatcher.TrieNoderoot| Constructor and Description |
|---|
SuffixStringMatcher(Collection suffixes)
Creates a new
PrefixStringMatcher which will match
Strings with any suffix in the supplied
Collection |
SuffixStringMatcher(String[] suffixes)
Creates a new
PrefixStringMatcher which will match
Strings 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, matchCharpublic SuffixStringMatcher(String[] suffixes)
PrefixStringMatcher which will match
Strings with any suffix in the supplied array.public SuffixStringMatcher(Collection suffixes)
PrefixStringMatcher which will match
Strings with any suffix in the supplied
Collectionpublic boolean matches(String input)
String is matched by a
suffix in the triematches in class TrieStringMatcherpublic String shortestMatch(String input)
input that is matched,
or null if no match exists.shortestMatch in class TrieStringMatcherpublic String longestMatch(String input)
input that is matched,
or null if no match exists.longestMatch in class TrieStringMatcherpublic static final void main(String[] argv)
Copyright © 2007, 2014, Oracle and/or its affiliates. All rights reserved.