Package ai.platon.pulsar.common
Class TrieStringMatcher
-
- All Implemented Interfaces:
public abstract class TrieStringMatcherTrieStringMatcher is a base class for simple tree-based string matching.
vincent
-
-
Method Summary
Modifier and Type Method Description abstract booleanmatches(String input)Returns true if the given Stringis matched by a pattern in the trieabstract StringshortestMatch(String input)Returns the shortest substring of inputthat is matched by a pattern in the trie, ornullif no match exists.abstract StringlongestMatch(String input)Returns the longest substring of inputthat is matched by a pattern in the trie, ornullif no match exists.-
-
Method Detail
-
matches
abstract boolean matches(String input)
Returns true if the given
Stringis matched by a pattern in the trie- Parameters:
input- a java.lang.String object.- Returns:
a boolean.
-
shortestMatch
abstract String shortestMatch(String input)
Returns the shortest substring of
inputthat is matched by a pattern in the trie, ornullif no match exists.- Parameters:
input- a java.lang.String object.- Returns:
a java.lang.String object.
-
longestMatch
abstract String longestMatch(String input)
Returns the longest substring of
inputthat is matched by a pattern in the trie, ornullif no match exists.- Parameters:
input- a java.lang.String object.- Returns:
a java.lang.String object.
-
-
-
-