/** * The rule specified by the regular expression. Note that, the regular * expression is specified in terms of Node name. For eg: TS.*RS -> means * TableScan Node followed by anything any number of times followed by * ReduceSink * * @param ruleName * name of the rule * @param regExp * regular expression for the rule **/ public RuleRegExp(String ruleName, String regExp) { this.ruleName = ruleName; if (patternHasWildCardChar(regExp)) { if (patternHasOnlyWildCardChar(regExp, '|')) { this.patternWithWildCardChar = null; this.patternWithoutWildCardChar = null; this.patternORWildChar = regExp.split("\\|"); } else { this.patternWithWildCardChar = Pattern.compile(regExp); this.patternWithoutWildCardChar = null; this.patternORWildChar = null; } } else { this.patternWithWildCardChar = null; this.patternWithoutWildCardChar = regExp; this.patternORWildChar = null; } }
/** * The rule specified by the regular expression. Note that, the regular * expression is specified in terms of Node name. For eg: TS.*RS -> means * TableScan Node followed by anything any number of times followed by * ReduceSink * * @param ruleName * name of the rule * @param regExp * regular expression for the rule **/ public RuleRegExp(String ruleName, String regExp) { this.ruleName = ruleName; if (patternHasWildCardChar(regExp)) { if (patternHasOnlyWildCardChar(regExp, '|')) { this.patternWithWildCardChar = null; this.patternWithoutWildCardChar = null; this.patternORWildChar = regExp.split("\\|"); } else { this.patternWithWildCardChar = Pattern.compile(regExp); this.patternWithoutWildCardChar = null; this.patternORWildChar = null; } } else { this.patternWithWildCardChar = null; this.patternWithoutWildCardChar = regExp; this.patternORWildChar = null; } }