当前位置: 首页>>代码示例>>Java>>正文


Java GuardEnum类代码示例

本文整理汇总了Java中com.espertech.esper.pattern.guard.GuardEnum的典型用法代码示例。如果您正苦于以下问题:Java GuardEnum类的具体用法?Java GuardEnum怎么用?Java GuardEnum使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


GuardEnum类属于com.espertech.esper.pattern.guard包,在下文中一共展示了GuardEnum类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: exitGuardPostFix

import com.espertech.esper.pattern.guard.GuardEnum; //导入依赖的package包/类
public void exitGuardPostFix(EsperEPL2GrammarParser.GuardPostFixContext ctx) {
    if (ctx.getChildCount() < 2) {
        return;
    }
    if (ctx.guardWhereExpression() == null && ctx.guardWhileExpression() == null) { // nested
        return;
    }
    String objectNamespace;
    String objectName;
    List<ExprNode> obsParameters;
    if (ctx.guardWhereExpression() != null) {
        objectNamespace = ctx.guardWhereExpression().getChild(0).getText();
        objectName = ctx.guardWhereExpression().getChild(2).getText();
        obsParameters = ASTExprHelper.exprCollectSubNodes(ctx.guardWhereExpression(), 3, astExprNodeMap);
    } else {
        objectNamespace = GuardEnum.WHILE_GUARD.getNamespace();
        objectName = GuardEnum.WHILE_GUARD.getName();
        obsParameters = ASTExprHelper.exprCollectSubNodes(ctx.guardWhileExpression(), 1, astExprNodeMap);
    }

    PatternGuardSpec guardSpec = new PatternGuardSpec(objectNamespace, objectName, obsParameters);
    EvalFactoryNode guardNode = patternNodeFactory.makeGuardNode(guardSpec);
    ASTExprHelper.patternCollectAddSubnodesAddParentNode(guardNode, ctx, astPatternNodeMap);
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:25,代码来源:EPLTreeWalkerListener.java

示例2: leaveGuard

import com.espertech.esper.pattern.guard.GuardEnum; //导入依赖的package包/类
private void leaveGuard(Tree node) throws ASTWalkException
{
    log.debug(".leaveGuard");
    String objectNamespace;
    String objectName;
    List<ExprNode> obsParameters;
    if (node.getChild(1).getType() == IDENT && node.getChild(2).getType() == IDENT) {
        objectNamespace = node.getChild(1).getText();
        objectName = node.getChild(2).getText();
        obsParameters = ASTExprHelper.getExprNodes(node, 3, astExprNodeMap);
    }
    else {
        objectNamespace = GuardEnum.WHILE_GUARD.getNamespace();
        objectName = GuardEnum.WHILE_GUARD.getName();
        obsParameters = ASTExprHelper.getExprNodes(node, 1, astExprNodeMap);
    }

    PatternGuardSpec guardSpec = new PatternGuardSpec(objectNamespace, objectName, obsParameters);
    EvalFactoryNode guardNode = patternNodeFactory.makeGuardNode(guardSpec);
    addEvalNodeExpression(guardNode, node);
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:22,代码来源:EPLTreeWalker.java

示例3: toPrecedenceFreeEPL

import com.espertech.esper.pattern.guard.GuardEnum; //导入依赖的package包/类
public void toPrecedenceFreeEPL(StringWriter writer) {
    getChildNodes().get(0).toEPL(writer, getPrecedence());
    if (patternGuardSpec.getObjectNamespace().equals(GuardEnum.WHILE_GUARD.getNamespace()) &&
            patternGuardSpec.getObjectName().equals(GuardEnum.WHILE_GUARD.getName())) {
        writer.write(" while ");
    } else {
        writer.write(" where ");
        writer.write(patternGuardSpec.getObjectNamespace());
        writer.write(":");
        writer.write(patternGuardSpec.getObjectName());
    }
    writer.write("(");
    ExprNodeUtilityCore.toExpressionStringParameterList(patternGuardSpec.getObjectParameters(), writer);
    writer.write(")");
}
 
开发者ID:espertechinc,项目名称:esper,代码行数:16,代码来源:EvalGuardFactoryNode.java

示例4: toPrecedenceFreeEPL

import com.espertech.esper.pattern.guard.GuardEnum; //导入依赖的package包/类
/**
 * Renders the expressions and all it's child expression, in full tree depth, as a string in
 * language syntax.
 * @param writer is the output to use
 * @param formatter for newline-whitespace formatting
 */
public void toPrecedenceFreeEPL(StringWriter writer, EPStatementFormatter formatter) {
    guarded.get(0).toEPL(writer, getPrecedence(), formatter);
    if (GuardEnum.isWhile(this.getNamespace(), this.getName())) {
        writer.write(" while (");
        this.getParameters().get(0).toEPL(writer, ExpressionPrecedenceEnum.MINIMUM);
        writer.write(")");
    }
    else {
        writer.write(" where ");
        super.toEPL(writer);
    }
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:19,代码来源:PatternGuardExpr.java

示例5: whileGuard

import com.espertech.esper.pattern.guard.GuardEnum; //导入依赖的package包/类
/**
 * While-guard expression.
 * @param expression expression to evaluate against matches
 * @param guarded is the sub-expression to guard
 * @return pattern guard
 */
public static PatternGuardExpr whileGuard(PatternExpr guarded, Expression expression)
{
    return new PatternGuardExpr(GuardEnum.WHILE_GUARD.getNamespace(), GuardEnum.WHILE_GUARD.getName(), new Expression[] {expression}, guarded);
}
 
开发者ID:mobile-event-processing,项目名称:Asper,代码行数:11,代码来源:Patterns.java


注:本文中的com.espertech.esper.pattern.guard.GuardEnum类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。