org.apache.nutch.util

## Class SuffixStringMatcher

- java.lang.Object
- - org.apache.nutch.util.TrieStringMatcher
  - - org.apache.nutch.util.SuffixStringMatcher

-     public class SuffixStringMatcher
      extends TrieStringMatcher

  A class for efficiently matching `String`s against a set of suffixes. Zero-length `Strings` are ignored.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.nutch.util.TrieStringMatcher

      `TrieStringMatcher.TrieNode`

  - ### Field Summary

    - ### Fields inherited from class org.apache.nutch.util.TrieStringMatcher

      `root`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SuffixStringMatcher(java.util.Collection<java.lang.String> suffixes)` Creates a new `PrefixStringMatcher` which will match `String`s with any suffix in the supplied `Collection`
    `SuffixStringMatcher(java.lang.String[] suffixes)` Creates a new `PrefixStringMatcher` which will match `String`s with any suffix in the supplied array.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `longestMatch(java.lang.String input)` Returns the longest suffix of `input` that is matched, or `null` if no match exists.
    `static void` | `main(java.lang.String[] argv)`
    `boolean` | `matches(java.lang.String input)` Returns true if the given `String` is matched by a suffix in the trie
    `java.lang.String` | `shortestMatch(java.lang.String input)` Returns the shortest suffix of `input` that is matched, or `null` if no match exists.

    - ### Methods inherited from class org.apache.nutch.util.TrieStringMatcher

      `addPatternBackward, addPatternForward, matchChar`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### SuffixStringMatcher

          public SuffixStringMatcher(java.lang.String[] suffixes)

      Creates a new `PrefixStringMatcher` which will match `String`s with any suffix in the supplied array.

    - #### SuffixStringMatcher

          public SuffixStringMatcher(java.util.Collection<java.lang.String> suffixes)

      Creates a new `PrefixStringMatcher` which will match `String`s with any suffix in the supplied `Collection`

  - ### Method Detail

    - #### matches

          public boolean matches(java.lang.String input)

      Returns true if the given `String` is matched by a suffix in the trie
      Specified by:
        `matches` in class `TrieStringMatcher`

    - #### shortestMatch

          public java.lang.String shortestMatch(java.lang.String input)

      Returns the shortest suffix of `input` that is matched, or `null` if no match exists.
      Specified by:
        `shortestMatch` in class `TrieStringMatcher`

    - #### longestMatch

          public java.lang.String longestMatch(java.lang.String input)

      Returns the longest suffix of `input` that is matched, or `null` if no match exists.
      Specified by:
        `longestMatch` in class `TrieStringMatcher`

    - #### main

          public static final void main(java.lang.String[] argv)

Copyright © 2019 The Apache Software Foundation