Class NFAStateNameHandler

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

public class NFAStateNameHandler extends Object
A utility class used to handle name conventions and guarantee unique names for the states of our NFA.
  • Field Details

  • Constructor Details

    • NFAStateNameHandler

      public NFAStateNameHandler()
  • Method Details

    • getOriginalNameFromInternal

      public static String getOriginalNameFromInternal(String internalName)
      Implements the reverse process of the getUniqueInternalName(String).
      Parameters:
      internalName - The name to be decoded.
      Returns:
      The original, user-specified name for the state.
    • checkNameUniqueness

      public void checkNameUniqueness(String name)
      Checks if the given name is already used or not. If yes, it throws a MalformedPatternException.
      Parameters:
      name - The name to be checked.
    • clear

      public void clear()
      Clear the names added during checking name uniqueness.
    • getUniqueInternalName

      public String getUniqueInternalName(String baseName)
      Used to give a unique name to NFA states created during the translation process. The name format will be baseName:counter , where the counter is increasing for states with the same baseName.
      Parameters:
      baseName - The base of the name.
      Returns:
      The (unique) name that is going to be used internally for the state.