Class NFACompiler

java.lang.Object
org.apache.flink.cep.nfa.compiler.NFACompiler

public class NFACompiler extends Object
Compiler class containing methods to compile a Pattern into a NFA or a NFACompiler.NFAFactory.
  • Field Details

  • Constructor Details

    • NFACompiler

      public NFACompiler()
  • Method Details

    • compileFactory

      public static <T> NFACompiler.NFAFactory<T> compileFactory(Pattern<T,?> pattern, boolean timeoutHandling)
      Compiles the given pattern into a NFACompiler.NFAFactory. The NFA factory can be used to create multiple NFAs.
      Type Parameters:
      T - Type of the input events
      Parameters:
      pattern - Definition of sequence pattern
      timeoutHandling - True if the NFA shall return timed out event patterns
      Returns:
      Factory for NFAs corresponding to the given pattern
    • canProduceEmptyMatches

      public static boolean canProduceEmptyMatches(Pattern<?,?> pattern)
      Verifies if the provided pattern can possibly generate empty match. Example of patterns that can possibly generate empty matches are: A*, A?, A* B? etc.
      Parameters:
      pattern - pattern to check
      Returns:
      true if empty match could potentially match the pattern, false otherwise