Class NFAStateNameHandler
java.lang.Object
org.apache.flink.cep.nfa.compiler.NFAStateNameHandler
A utility class used to handle name conventions and guarantee unique names for the states of our
NFA.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckNameUniqueness(String name) Checks if the given name is already used or not.voidclear()Clear the names added during checking name uniqueness.static StringgetOriginalNameFromInternal(String internalName) Implements the reverse process of thegetUniqueInternalName(String).getUniqueInternalName(String baseName) Used to give a unique name toNFAstates created during the translation process.
-
Field Details
-
STATE_NAME_DELIM
- See Also:
-
-
Constructor Details
-
NFAStateNameHandler
public NFAStateNameHandler()
-
-
Method Details
-
getOriginalNameFromInternal
Implements the reverse process of thegetUniqueInternalName(String).- Parameters:
internalName- The name to be decoded.- Returns:
- The original, user-specified name for the state.
-
checkNameUniqueness
Checks if the given name is already used or not. If yes, it throws aMalformedPatternException.- Parameters:
name- The name to be checked.
-
clear
public void clear()Clear the names added during checking name uniqueness. -
getUniqueInternalName
Used to give a unique name toNFAstates created during the translation process. The name format will bebaseName:counter, where the counter is increasing for states with the samebaseName.- Parameters:
baseName- The base of the name.- Returns:
- The (unique) name that is going to be used internally for the state.
-