Class RegExComparator

  • All Implemented Interfaces:
    Operator.StringComparator

    public class RegExComparator
    extends Object
    implements Operator.StringComparator
    Be executed under 1.4 uses java.util.regex.Pattern functionality. Otherwise understands only "." and "*" simbols, i.e. regexprs like ".*Ques.ion.*".
    • Constructor Detail

      • RegExComparator

        public RegExComparator()
    • Method Detail

      • equals

        public boolean equals​(String caption,
                              String match)
        Description copied from interface: Operator.StringComparator
        Imlementation must return true if strings are equal.
        Specified by:
        equals in interface Operator.StringComparator
        Parameters:
        caption - a text to compare with pattern.
        match - a pattern
        Returns:
        true if text and pattern matches.
      • parse

        public boolean parse​(String caption,
                             String match)
        Checks that caption matshes the pattern. Understands only "." (any symbol) and "*" (repeat symbol). Used for 1.3 and earclier javas, starting from 1.4 java.util.regex.Pattern class is used.
        Parameters:
        caption - a caption to compare with the pattern.
        match - a pattern
        Returns:
        true if the caption matches the pattern.