Package 

Class SuffixStringMatcher

    • Constructor Summary

      Constructors 
      Constructor Description
      SuffixStringMatcher(Array<String> suffixes) Creates a new PrefixStringMatcher which will matchStrings with any suffix in the supplied array.
      SuffixStringMatcher(Collection<String> suffixes) Creates a new PrefixStringMatcher which will matchStrings with any suffix in the suppliedCollection
    • Method Summary

      Modifier and Type Method Description
      final static void main(Array<String> argv) main.
      boolean matches(String input) Returns true if the given String is matched by a pattern inthe trie Returns true if the given String is matched by a suffix in thetrie
      String shortestMatch(String input) Returns the shortest substring of input that ismatched by a pattern in the trie, or null if no matchexists. Returns the shortest suffix of input that is matched,or null if no match exists.
      String longestMatch(String input) Returns the longest substring of input that ismatched by a pattern in the trie, or null if no matchexists. Returns the longest suffix of input that is matched,or null if no match exists.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SuffixStringMatcher

        SuffixStringMatcher(Array<String> suffixes)
        Creates a new PrefixStringMatcher which will matchStrings with any suffix in the supplied array.
        Parameters:
        suffixes - an array of java.lang.String objects.
      • SuffixStringMatcher

        SuffixStringMatcher(Collection<String> suffixes)
        Creates a new PrefixStringMatcher which will matchStrings with any suffix in the suppliedCollection
        Parameters:
        suffixes - a java.util.Collection object.
    • Method Detail

      • matches

         boolean matches(String input)

        Returns true if the given String is matched by a pattern inthe trie Returns true if the given String is matched by a suffix in thetrie

      • shortestMatch

         String shortestMatch(String input)

        Returns the shortest substring of input that ismatched by a pattern in the trie, or null if no matchexists. Returns the shortest suffix of input that is matched,or null if no match exists.

      • longestMatch

         String longestMatch(String input)

        Returns the longest substring of input that ismatched by a pattern in the trie, or null if no matchexists. Returns the longest suffix of input that is matched,or null if no match exists.