Class FullTextMatcher

All Implemented Interfaces:
IHeaderMatcher

public class FullTextMatcher extends AbstractSimpleMatcher
Accumulates all letters and numbers contained inside the header and compares it to the full text of a given license (after reducing it to letters and numbers as well).

The text comparison is case insensitive but assumes only characters in the US-ASCII charset are being matched.

  • Constructor Details

    • FullTextMatcher

      public FullTextMatcher(String fullText)
      Constructs the full text matcher with a unique random id and the specified text to match.
      Parameters:
      fullText - the text to match
    • FullTextMatcher

      public FullTextMatcher(String id, String fullText)
      Constructs the full text matcher for the specified text.
      Parameters:
      id - the id for the matcher
      fullText - the text to match
  • Method Details

    • prune

      public static String prune(String text)
      Removes everything except letter or digit from text.
      Parameters:
      text - The text to remove extra chars from.
      Returns:
      the pruned text.
    • doMatch

      public boolean doMatch(String line)
      Description copied from class: AbstractSimpleMatcher
      Performs the actual match test.
      Specified by:
      doMatch in class AbstractSimpleMatcher
      Parameters:
      line - the line to check.
      Returns:
      true if the line matches, false otherwise.
    • reset

      public void reset()
      Description copied from interface: IHeaderMatcher
      Resets this state State.i. If text is being cached this method should clear that cache.
      Specified by:
      reset in interface IHeaderMatcher
      Overrides:
      reset in class AbstractSimpleMatcher