本文整理匯總了Java中net.ssehub.easy.varModel.cst.OCLFeatureCall.getParameterCount方法的典型用法代碼示例。如果您正苦於以下問題:Java OCLFeatureCall.getParameterCount方法的具體用法?Java OCLFeatureCall.getParameterCount怎麽用?Java OCLFeatureCall.getParameterCount使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類net.ssehub.easy.varModel.cst.OCLFeatureCall
的用法示例。
在下文中一共展示了OCLFeatureCall.getParameterCount方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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;
}
}
示例2: 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;
}
}
示例3: unpackConstraints
import net.ssehub.easy.varModel.cst.OCLFeatureCall; //導入方法依賴的package包/類
/**
* Unpacks the constraints and extracts the values. This is currently just a workaround as long as the reasoner
* is not able to work with that.
*
* @param assng the attribute assignment to unpack
* @param values the attribute-value-mapping (to be modified as a side effect)
*/
private void unpackConstraints(AttributeAssignment assng, Map<String, Value> values) {
for (int r = 0; r < assng.getRealizingCount(); r++) {
ConstraintSyntaxTree constr = assng.getRealizing(r).getConsSyntax();
if (constr instanceof OCLFeatureCall) {
OCLFeatureCall call = (OCLFeatureCall) constr;
if (1 == call.getParameterCount() && OclKeyWords.ASSIGNMENT.equals(call.getOperation())) {
ConstraintSyntaxTree p0 = call.getOperand();
ConstraintSyntaxTree p1 = call.getParameter(0);
if (p0 instanceof Variable && p1 instanceof ConstantValue) {
AbstractVariable var = ((Variable) p0).getVariable();
String key = var.getName();
if (!values.containsKey(key)) {
values.put(key, ((ConstantValue) p1).getConstantValue());
}
}
}
}
}
}
示例4: visitMultiAndExpression
import net.ssehub.easy.varModel.cst.OCLFeatureCall; //導入方法依賴的package包/類
@Override
public void visitMultiAndExpression(MultiAndExpression expression) {
for (int e = 0; e < expression.getExpressionCount(); e++) {
OCLFeatureCall call = expression.getExpression(e);
if (0 == e) {
call.getOperand().accept(this);
appendOutput(WHITESPACE);
}
for (int p = 0; p < call.getParameterCount(); p++) {
appendOutput(call.getOperation());
appendOutput(WHITESPACE);
call.getParameter(p).accept(this);
if (!(e + 1 == expression.getExpressionCount() && p + 1 == call.getParameterCount())) {
// do not emit the very last whitespace
appendOutput(WHITESPACE);
}
}
}
}
示例5: doJavaSyntax
import net.ssehub.easy.varModel.cst.OCLFeatureCall; //導入方法依賴的package包/類
/**
*Expression with operation intrinsically supported by Drools is processed
* in Java style.
* @param call OCL FeatureCall.
* @param op Operation.
*/
private void doJavaSyntax(OCLFeatureCall call, String op) {
String operation = DroolsOperations.getDroolsOperation(op);
call.getOperand().accept(this);
rule += " ";
compoundInitValue += " ";
if (operation.equals(OclKeyWords.EQUALS)) {
rule += "==";
rule += " ";
compoundInitValue += "== ";
} else {
rule += " ";
rule += operation;
rule += " ";
compoundInitValue += " " + operation + " ";
}
for (int i = 0; i < call.getParameterCount(); i++) {
call.getParameter(i).accept(this);
if (i != (call.getParameterCount() - 1)) {
rule += " ";
compoundInitValue += " ";
}
}
}
示例6: visitOclFeatureCall
import net.ssehub.easy.varModel.cst.OCLFeatureCall; //導入方法依賴的package包/類
@Override
public void visitOclFeatureCall(OCLFeatureCall call) {
if (call.getResolvedOperation() == BooleanType.IMPLIES) {
// exclude the condition
for (int p = 0; p < call.getParameterCount(); p++) {
call.getParameter(p).accept(this);
}
} else {
super.visitOclFeatureCall(call);
}
}
示例7: visitOclFeatureCall
import net.ssehub.easy.varModel.cst.OCLFeatureCall; //導入方法依賴的package包/類
@Override
public void visitOclFeatureCall(OCLFeatureCall call) {
if (null == call.getResolvedOperation()) {
addError("Operation of OclFeatureCall could not be resolved.", call,
ValidationMessage.UNRESOLVED_OPERATION);
}
if (null != call.getOperand()) {
call.getOperand().accept(this);
} // then call.getAccessor() shall be given!
for (int i = 0, n = call.getParameterCount(); i < n; i++) {
call.getParameter(i).accept(this);
}
}
示例8: visitOclFeatureCall
import net.ssehub.easy.varModel.cst.OCLFeatureCall; //導入方法依賴的package包/類
@Override
public void visitOclFeatureCall(OCLFeatureCall call) {
if (call.getOperand().getClass().getSimpleName().equalsIgnoreCase("Variable")
&& call.getParameterCount() == 1
&& call.getParameter(0).getClass().getSimpleName().equalsIgnoreCase("ConstantValue")
&& call.getOperation().equals(OclKeyWords.ASSIGNMENT)) {
defaultAssignmentConstraint = true;
}
}
示例9: visitOclFeatureCall
import net.ssehub.easy.varModel.cst.OCLFeatureCall; //導入方法依賴的package包/類
@Override
public void visitOclFeatureCall(OCLFeatureCall call) {
if (ruleItr == 0) {
defaultStatus = call.getOperation().equals("=");
call.getOperand().accept(this);
rule += " ";
if (call.getOperand() instanceof Variable && (call.getParameter(0) instanceof ConstantValue)) {
ConstantValue val = (ConstantValue) call.getParameter(0);
if (!(val.getConstantValue() instanceof CompoundValue)) {
rule += "=";
}
} else {
rule += "=";
}
ruleItr++;
rule += " ";
boolean rhsIsConstantValue = call.getParameterCount() == 1
&& call.getParameter(0) instanceof ConstantValue;
if (rhsIsConstantValue && call.getOperation().equals("=")) {
isGroup0 = true;
} else if (rhsIsConstantValue && call.getOperation().equals("==")) {
isGroup0 = false;
}
for (int i = 0; i < call.getParameterCount(); i++) {
call.getParameter(i).accept(this);
}
} else {
doModification(call);
}
}
示例10: visitOclFeatureCall
import net.ssehub.easy.varModel.cst.OCLFeatureCall; //導入方法依賴的package包/類
@Override
public void visitOclFeatureCall(OCLFeatureCall call) {
// operations are considered in project
call.getOperand().accept(this);
int pCount = call.getParameterCount();
for (int p = 0; p < pCount; p++) {
call.getParameter(p).accept(this);
}
}
示例11: visitOclFeatureCall
import net.ssehub.easy.varModel.cst.OCLFeatureCall; //導入方法依賴的package包/類
@Override
public void visitOclFeatureCall(OCLFeatureCall call) {
// simple comparisons are already of this kind
call.getOperand().accept(this);
for (int a = 0; a < call.getParameterCount(); a++) {
call.getParameter(a).accept(this);
}
}
示例12: doLispSyntax
import net.ssehub.easy.varModel.cst.OCLFeatureCall; //導入方法依賴的package包/類
/**
* Expression with operation not intrinsically supported by Drools is processed
* in Lisp style.
* @param call OCL FeatureCall.
* @param op Operation.
*/
private void doLispSyntax(OCLFeatureCall call, String op) {
rule += DroolsOperations.getDroolsOperation(op) + "(";
compoundInitValue += DroolsOperations.getDroolsOperation(op) + "(";
call.getOperand().accept(this);
boolean hasParams = (call.getParameterCount() != 0);
if (hasParams) {
rule += " , ";
compoundInitValue += " , ";
}
for (int i = 0; i < call.getParameterCount(); i++) {
call.getParameter(i).accept(this);
if (i != (call.getParameterCount() - 1)) {
rule += " , ";
compoundInitValue += " , ";
} else {
rule += " ";
compoundInitValue += " ";
}
}
if (currentOperation.equals(OclKeyWords.IS_DEFINED)) {
rule += "\"";
}
rule += " )";
compoundInitValue += " )";
}
示例13: doLispSyntax
import net.ssehub.easy.varModel.cst.OCLFeatureCall; //導入方法依賴的package包/類
/**
* Expression with operation not intrinsically supported by Drools is processed
* in Lisp style.
* @param call OCL FeatureCall.
* @param op Operation.
*/
private void doLispSyntax(OCLFeatureCall call, String op) {
String operation = DroolsOperations.getDroolsOperation(op);
this.currentOp = operation;
constraint += operation + "(";
call.getOperand().accept(this);
boolean hasParams = (call.getParameterCount() != 0);
if (modificationConstraint && hasParams) {
modification += " , ";
} else if (!modificationConstraint && hasParams) {
constraint += " , ";
}
for (int i = 0; i < call.getParameterCount(); i++) {
call.getParameter(i).accept(this);
if (i != (call.getParameterCount() - 1)) {
constraint += " , ";
} else {
constraint += " ";
}
}
if (currentOp.equals("ivmlDef")) {
constraint += "\"";
currentOp = "";
}
constraint += ")";
}
示例14: 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);
}
}
示例15: getCompoundConstraintType
import net.ssehub.easy.varModel.cst.OCLFeatureCall; //導入方法依賴的package包/類
/**
* Type of call the constraint in the compound represents, modification or hard.
* @param call OCL Call.
* @return Returns the type of the call. 0 if modification, else 1.
*/
private int getCompoundConstraintType(OCLFeatureCall call) {
boolean operationIsEquals = (call.getOperation().equals(OclKeyWords.EQUALS));
boolean operationIsAssignment = (call.getOperation().equals(OclKeyWords.ASSIGNMENT));
boolean isModification = operationIsEquals || operationIsAssignment;
int operationTyp = 1;
if (isModification) {
if (call.getOperand() instanceof Variable) {
operationTyp = 0;
} else if (call.getOperand() instanceof CompoundAccess) {
operationTyp = 0;
} else {
operationTyp = 1;
}
} else {
if (call.getOperation().equals(OclKeyWords.IMPLIES)) {
boolean theRHSisOCL = call.getParameter(0) instanceof OCLFeatureCall;
if (theRHSisOCL) {
OCLFeatureCall call2 = (OCLFeatureCall) call.getParameter(0);
if (call2.getOperation().equals(OclKeyWords.EQUALS) && call2.getParameterCount() == 1) {
if (call2.getOperand() instanceof Variable || call2.getOperand() instanceof CompoundAccess) {
operationTyp = 2;
}
}
}
} else {
operationTyp = 1;
}
}
return operationTyp;
}