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


Java OCLFeatureCall.getOperation方法代码示例

本文整理汇总了Java中net.ssehub.easy.varModel.cst.OCLFeatureCall.getOperation方法的典型用法代码示例。如果您正苦于以下问题:Java OCLFeatureCall.getOperation方法的具体用法?Java OCLFeatureCall.getOperation怎么用?Java OCLFeatureCall.getOperation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.ssehub.easy.varModel.cst.OCLFeatureCall的用法示例。


在下文中一共展示了OCLFeatureCall.getOperation方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: visitOclFeatureCall

import net.ssehub.easy.varModel.cst.OCLFeatureCall; //导入方法依赖的package包/类
@Override
public void visitOclFeatureCall(OCLFeatureCall call) {
    // TODO consider re-assignments of constraint variables
    String op = call.getOperation();
    ConstraintSyntaxTree operand = call.getOperand();
    
    if (OclKeyWords.IS_DEFINED.equals(op)) {
        nextVarIsMandatory = true;
        operand.accept(this);
        nextVarIsMandatory = false;
    } else if (!OclKeyWords.ASSIGNMENT.equals(op) && null != operand) {
        // Most assignments should not be considered
        operand.accept(this);
        for (int i = 0; i < call.getParameterCount(); i++) {
            call.getParameter(i).accept(this);
        }
    }
}
 
开发者ID:SSEHUB,项目名称:EASyProducer,代码行数:19,代码来源:MandatoryDeclarationClassifier.java

示例2: visitOclFeatureCall

import net.ssehub.easy.varModel.cst.OCLFeatureCall; //导入方法依赖的package包/类
@Override
public void visitOclFeatureCall(OCLFeatureCall call) {
    if (null != call.getOperand()) { // user defined function!
        call.getOperand().accept(this);
    }
    
    String op = call.getOperation();
    if (OclKeyWords.INDEX_ACCESS.equals(op) || OclKeyWords.AT.equals(op)) {
        // Index based access to elements of a container
        parents.addFirst(lastVariable);
        for (int i = 0; i < call.getParameterCount(); i++) {
            call.getParameter(i).accept(this);
        }
        parents.removeFirst();
    } else {
        for (int i = 0; i < call.getParameterCount(); i++) {
            call.getParameter(i).accept(this);
        }
    }
}
 
开发者ID:SSEHUB,项目名称:EASyProducer,代码行数:21,代码来源:IDecisionVariableInConstraintFinder.java

示例3: visitOclFeatureCall

import net.ssehub.easy.varModel.cst.OCLFeatureCall; //导入方法依赖的package包/类
@Override
public void visitOclFeatureCall(OCLFeatureCall call) {
    
    this.innerlogic += "( ";
    String op = call.getOperation();
    if (DroolsOperations.isImplicitOperation(op)) {
        call.getOperand().accept(this);
        this.innerlogic += " " + DroolsOperations.getDroolsOperation(op) + " ";
        call.getParameter(0).accept(this);
    } else {
        innerlogic += op;
        innerlogic += "(";
        call.getOperand().accept(this);
        innerlogic += " , ";
        call.getParameter(0).accept(this);
        innerlogic += ")";
    }
    innerlogic += ")";
}
 
开发者ID:SSEHUB,项目名称:EASyProducer,代码行数:20,代码来源:DroolsAssignmentsVisitor.java

示例4: visitOclFeatureCall

import net.ssehub.easy.varModel.cst.OCLFeatureCall; //导入方法依赖的package包/类
@Override
public void visitOclFeatureCall(OCLFeatureCall call) {
    String op = call.getOperation();
    currentOperation = op;
    int result = getCalltype(call);
    
    switch (result) {
    case 0:
        variableStatusChecker = "dList.contains";
        call.getOperand().accept(this);
        this.modificationConstraint = true;
        rhsIndicator++;
        for (int i = 0; i < call.getParameterCount(); i++) {
            call.getParameter(i).accept(this);
        }
        break;

    case 1:
        notModificationRule(call, op);
        break;
        
    default:
        logger.info("");
        break;
    }
}
 
开发者ID:SSEHUB,项目名称:EASyProducer,代码行数:27,代码来源:DroolsConstraintVisitor.java

示例5: notModificationRule

import net.ssehub.easy.varModel.cst.OCLFeatureCall; //导入方法依赖的package包/类
/**
 * Method to process where there is no modification, i.e. Pure hard constraints or validations. 
 * @param call OCL Call.
 * @param operation Operation.
 */
private void notModificationRule(OCLFeatureCall call, String operation) {

    // Check this in future.
    // To mitigate the problem with equalities involving reals, ocl calls are rewritten 
    // as not(unequals - expression)
    OCLFeatureCall callA = call;
    if (!modificationConstraint) {
        callA = processEqualityCall(call, operation, callA);
        
    } else {
        if (this.mvelModeIndicator != 0) {
            callA = processEqualityCall(call, operation, callA);
        }
    }
    operation = callA.getOperation();
    
    if (DroolsOperations.isImplicitOperation(operation)) {
        doJavaSyntax(callA, operation);
    } else {
        if (!DroolsOperations.isOperationSupported(operation)) {
            ruleSupported = false;
        }
        doLispSyntax(callA, operation);
    }
}
 
开发者ID:SSEHUB,项目名称:EASyProducer,代码行数:31,代码来源:DroolsConstraintVisitor.java

示例6: visitOclFeatureCall

import net.ssehub.easy.varModel.cst.OCLFeatureCall; //导入方法依赖的package包/类
@Override
public void visitOclFeatureCall(OCLFeatureCall call) {
    String op = call.getOperation();
    currentOp = op;
    int result = getCalltype(call);
    
    switch (result) {
    case 0:
        variableStatusChecker = "dList.contains";
        call.getOperand().accept(this);
        this.modificationConstraint = true;
        rhsIndicator++;
        for (int i = 0; i < call.getParameterCount(); i++) {
            call.getParameter(i).accept(this);
        }
        break;

    case 1:
        notModificationRule(call, op);
        break;
        
    default:
        logger.info("");
        break;
    }
}
 
开发者ID:SSEHUB,项目名称:EASyProducer,代码行数:27,代码来源:DroolsEqualityEvaluator.java

示例7: notModificationRule

import net.ssehub.easy.varModel.cst.OCLFeatureCall; //导入方法依赖的package包/类
/**
 * Method to process which do not have any constraints plus modifications. 
 * @param call Ocl call.
 * @param op Operation.
 */
private void notModificationRule(OCLFeatureCall call, String op) {

    // Check this in future.
    // To mitigate the problem with equalities involving reals, ocl calls are rewritten 
    // as not(unequals - expression)
    OCLFeatureCall callA = call;
    if (!modificationConstraint) {
        callA = processEqualityCall(call, op, callA);
        
    } 
    op = callA.getOperation();
    
    if (DroolsOperations.isImplicitOperation(op)) {
        doJavaSyntax(callA, op);
    } else {
        if (!DroolsOperations.isOperationSupported(op)) {
            ruleSupported = false;
        }
        doLispSyntax(callA, op);
    }
}
 
开发者ID:SSEHUB,项目名称:EASyProducer,代码行数:27,代码来源:DroolsEqualityEvaluator.java

示例8: visitOclFeatureCall

import net.ssehub.easy.varModel.cst.OCLFeatureCall; //导入方法依赖的package包/类
@Override
public void visitOclFeatureCall(OCLFeatureCall call) {
    this.innerlogic += "( ";
    String op = call.getOperation();
    if (DroolsOperations.isImplicitOperation(op)) {
        call.getOperand().accept(this);
        this.innerlogic += " " + DroolsOperations.getDroolsOperation(op) + " ";
        call.getParameter(0).accept(this);
    } else {
        innerlogic += op;
        innerlogic += "(";
        call.getOperand().accept(this);
        innerlogic += " , ";
        call.getParameter(0).accept(this);
        innerlogic += ")";
    }
    innerlogic += ")";
}
 
开发者ID:SSEHUB,项目名称:EASyProducer,代码行数:19,代码来源:AssignmentAttributeConstraints.java

示例9: visitOclFeatureCall

import net.ssehub.easy.varModel.cst.OCLFeatureCall; //导入方法依赖的package包/类
@Override
public void visitOclFeatureCall(OCLFeatureCall call) {
    this.innerlogic += "( ";
    String op = call.getOperation();
    if (DroolsOperations.isImplicitOperation(op)) {
        call.getOperand().accept(this);
        this.innerlogic += " " + DroolsOperations.getDroolsOperation(op) + " ";
        call.getParameter(0).accept(this);
    } else {
        innerlogic += DroolsOperations.getDroolsOperation(op);
        innerlogic += "(";
        call.getOperand().accept(this);
        innerlogic += " , ";
        call.getParameter(0).accept(this);
        innerlogic += ")";
    }
    innerlogic += ")";
}
 
开发者ID:SSEHUB,项目名称:EASyProducer,代码行数:19,代码来源:DroolsImpliesEvaluator.java

示例10: getCalltype

import net.ssehub.easy.varModel.cst.OCLFeatureCall; //导入方法依赖的package包/类
/**
     * Method to identify the type of constraint.
     * @param call OCL call.
     * @return 0 if it is a soft constraint, 1 if it is a hard constraint.
     */
    private int getCalltype(OCLFeatureCall call) {
        int result = 0;
        String op = call.getOperation();
        boolean operationIsImplies = op.equals(OclKeyWords.IMPLIES);
        int params = call.getParameterCount();
        
        if (operationIsImplies && rhsIndicator == 0 && (params == 1) 
                && call.getParameter(0).getClass().equals(call.getClass())) {
            OCLFeatureCall temp = (OCLFeatureCall) call.getParameter(0);
            boolean operationisEquals = temp.getOperation().equals(OclKeyWords.EQUALS);
            if (operationisEquals && (ruleCounter == 0)
                    && (temp.getOperand() instanceof Variable)) {
                result = 0;
                
            } else if (temp.getOperation().equals(OclKeyWords.EQUALS) && (ruleCounter == 0)
                    && (temp.getOperand() instanceof CompoundAccess)) {
                result = 0;
            } else {
                rhsIndicator++;
                result = 1;
            }
        } else if (operationIsImplies && (rhsIndicator == 0) 
                && (call.getParameter(0) instanceof Parenthesis)) {
            rhsIndicator++;
            result = 1;
//            call1.accept(this);
        } else {
            rhsIndicator++;
            result = 1;
        }
        
        return result;
    }
 
开发者ID:SSEHUB,项目名称:EASyProducer,代码行数:39,代码来源:DroolsConstraintVisitor.java

示例11: visitOclFeatureCall

import net.ssehub.easy.varModel.cst.OCLFeatureCall; //导入方法依赖的package包/类
@Override
public void visitOclFeatureCall(OCLFeatureCall call) {
    currentOperation = call.getOperation();
    call.getOperand().accept(this);
    
    for (int i = 0; i < call.getParameterCount(); i++) {
        call.getParameter(i).accept(this);
    }
}
 
开发者ID:SSEHUB,项目名称:EASyProducer,代码行数:10,代码来源:ConstraintChecker.java

示例12: visitOclFeatureCall

import net.ssehub.easy.varModel.cst.OCLFeatureCall; //导入方法依赖的package包/类
@Override
public void visitOclFeatureCall(OCLFeatureCall call) {
    super.visitOclFeatureCall(call);
    EvaluationAccessor result = getResultAccessor(true);

    EvaluationAccessor operand = null;
    EvaluationAccessor[] parameter = new EvaluationAccessor[call.getParameterCount()];
    int startRelSize = relevant.size(); // initial size before evaluating operand
    allowUpdateRelevant = true;
    if (null != call.getOperand()) {
        call.getOperand().accept(this);
        operand = getResultAccessor(true);
    }
    int opRelSize = relevant.size(); // may change while evaluating operand
    for (int p = 0; p < call.getParameterCount(); p++) {
        call.getParameter(p).accept(this);
        parameter[p] = getResultAccessor(true);
    }
    allowUpdateRelevant = false;
    ConstraintSyntaxTree[] cst = getFailedExpression();
    // this is just a very limited form of analysis - just for the beginning
    if (null != cst && contains(cst, call) && 1 == parameter.length) {
        int startIndex;
        int endIndex;
        boolean operandRelevant;
        if (startRelSize < opRelSize) {
            operandRelevant = true; // there was a relevant variable while evaluating operand
            startIndex = startRelSize;
            endIndex = opRelSize - 1;
        } else {
            operandRelevant = false;
            startIndex = opRelSize;
            endIndex = relevant.size() - 1;
        }
        Double op = toDouble(operand);
        Double param = toDouble(parameter[0]);
        Double deviation = null;
        Double deviationPercentage = null;
        String opName = call.getOperation();
        if (null != op && null != param) {
            if (oclOp1ParamDeviation.contains(opName)) {
                if (operandRelevant) { 
                    deviation = param - op;
                    deviationPercentage = deviation / op;
                } else {
                    deviation = op - param;
                    deviationPercentage = deviation / param;
                }
            }
        }
        for (int r = startIndex; r <= endIndex; r++) {
            IDecisionVariable var = relevant.get(r);
            addViolatingInstance(createViolationInstance(var, opName, deviation, deviationPercentage));
        }
    }
    release(operand);
    for (int p = 0; p < parameter.length; p++) {
        release(parameter[p]);
    }
    setResultAcessor(result); // set back original result (accessor), shall be null due to nullifying op/param
}
 
开发者ID:SSEHUB,项目名称:EASyProducer,代码行数:62,代码来源:AbstractAnalyzerVisitor.java

示例13: visitOclFeatureCall

import net.ssehub.easy.varModel.cst.OCLFeatureCall; //导入方法依赖的package包/类
@Override
public void visitOclFeatureCall(OCLFeatureCall call) {
    callStack.push(call);
    FormattingHint hint;
    Operation resolved = call.getResolvedOperation();
    if (null != resolved) {
        hint = resolved.getFormattingHint();
    } else {
        hint = FormattingHint.FUNCTION_CALL;
    }            
    String name = call.getOperation();
    switch (hint) {
    case FUNCTION_CALL:
        if (OclKeyWords.INDEX_ACCESS.equals(name) && 1 == call.getParameterCount()) {
            call.getOperand().accept(this);
            appendOutput("[");
            call.getParameter(0).accept(this);
            appendOutput("]");
        } else {
            appendOutput(name);
            appendOutput("(");
            ConstraintSyntaxTree operand = call.getOperand();
            if (null != operand) {
                operand.accept(this);
            }
            if (call.getParameterCount() > 0) {
                for (int p = 0; p < call.getParameterCount(); p++) {
                    ConstraintSyntaxTree param = call.getParameter(p);
                    if (null != operand || (null == operand && p > 0)) {
                        appendOutput(",");
                    }
                    if (null != param.getName()) {
                        appendOutput(WHITESPACE);
                        appendOutput(param.getName());
                        appendOutput(WHITESPACE);
                        appendOutput("=");
                    }
                    appendOutput(WHITESPACE);
                    param.accept(this);
                }
            }
            appendOutput(")");
        }
        break;
    case OPERATOR_INFIX:
        call.getOperand().accept(this);
        for (int p = 0; p < call.getParameterCount(); p++) {
            appendOutput(WHITESPACE);
            appendOutput(name);
            appendOutput(WHITESPACE);
            call.getParameter(p).accept(this);
        }
        break;
    case OPERATOR_PREFIX:
        appendOutput(name);
        appendOutput(WHITESPACE);
        call.getOperand().accept(this);
        // it is ensured that there are no more parameters
        break;
    case OPERATOR_POSTFIX:
        call.getOperand().accept(this);
        appendOutput(name);
        // it is ensured that there are no more parameters
        break;
    default:
        // should not occur
        break;
    }
    callStack.pop();
}
 
开发者ID:SSEHUB,项目名称:EASyProducer,代码行数:71,代码来源:IVMLWriter.java


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