Class PrefixStringMatcher

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      PrefixStringMatcher(Array<String> prefixes) Creates a new PrefixStringMatcher which will match Strings with any prefix in the supplied array.
      PrefixStringMatcher(Collection<String> prefixes) Creates a new PrefixStringMatcher which will match Strings with any prefix in the supplied Collection.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • 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 in the trie Returns true if the given String is matched by a prefix in the trie
      String shortestMatch(String input) Returns the shortest substring of input
       that is 
           matched by a pattern in the trie, or 
      null
       if no match 
           exists.
           
            
           
            Returns the shortest prefix of 
      input
       that is matched, 
           or 
      null
       if no match exists.
      String longestMatch(String input) Returns the longest substring of input
       that is 
           matched by a pattern in the trie, or 
      null
       if no match 
           exists.
           
            
           
            Returns the longest prefix 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

      • PrefixStringMatcher

        PrefixStringMatcher(Array<String> prefixes)
        Creates a new PrefixStringMatcher which will match Strings with any prefix in the supplied array.
        Parameters:
        prefixes - an array of java.lang.String objects.
      • PrefixStringMatcher

        PrefixStringMatcher(Collection<String> prefixes)
        Creates a new PrefixStringMatcher which will match Strings with any prefix in the supplied Collection.
        Parameters:
        prefixes - a java.util.Collection object.
    • Method Detail

      • matches

         boolean matches(String input)

        Returns true if the given String is matched by a pattern in the trie Returns true if the given String is matched by a prefix in the trie

      • shortestMatch

         String shortestMatch(String input)

        Returns the shortest substring of input

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

      • longestMatch

         String longestMatch(String input)

        Returns the longest substring of input

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