Examples of TCGVariable


Examples of net.amin.mobateg.helper.variables.TCGVariable

  private static void oclAtomConstraintVisitor(TCGOCLAtomImpl tcgOCLAtomConstraint){
   
    if (tcgOCLAtomConstraint.getElement() instanceof Property) {  //class property
      Property oProp = (Property) tcgOCLAtomConstraint.getElement();
     
      TCGVariable toBeAdd = new TCGVariable();
      toBeAdd.setName(oProp.getName());
      toBeAdd.setType(typeOfVariable(oProp.getType()));
      toBeAdd.setIsParameter(false);
     
      if(!((PropertyCallExp)(tcgOCLAtomConstraint.getOclReference())).isMarkedPre()){
        //Add property     
        if(!propertyThatHasNotAtPre.contains(toBeAdd))
          propertyThatHasNotAtPre.add(toBeAdd);
      }
    }
    else if (tcgOCLAtomConstraint.getElement() instanceof Variable) {  //input parameter
      Variable oVar = (Variable)tcgOCLAtomConstraint.getElement();
      if (oVar != null) {       
        //add variable
        TCGVariable toBeAdd = new TCGVariable();
        if(oVar.getRepresentedParameter() != null && oVar.getRepresentedParameter().getDefaultValue() != null)
          toBeAdd.setInitialValue(oVar.getRepresentedParameter().getDefaultValue().stringValue());
        toBeAdd.setName(oVar.getName());
        toBeAdd.setType(typeOfVariable(oVar.getType()));
        toBeAdd.setIsParameter(true);
        if(toBeAdd.getType() != null && !propertyThatHasNotAtPre.contains(toBeAdd))
          propertyThatHasNotAtPre.add(toBeAdd);   
      }
    }
  }
View Full Code Here

Examples of net.amin.mobateg.helper.variables.TCGVariable

    if (tcgOCLAtomConstraint.getElement() instanceof Variable) {  //input parameter
      Variable oVar = (Variable)tcgOCLAtomConstraint.getElement();
      if (oVar != null) {       
        //add variable
        TCGVariable toBeAdd = new TCGVariable();
        if(oVar.getRepresentedParameter() != null && oVar.getRepresentedParameter().getDefaultValue() != null)
          toBeAdd.setInitialValue(oVar.getRepresentedParameter().getDefaultValue().stringValue());
        toBeAdd.setName(oVar.getName());
        toBeAdd.setType(typeOfVariable(oVar.getType()));
        toBeAdd.setIsParameter(true);
        if(toBeAdd.getType() != null && !AllVariables.contains(toBeAdd))
          AllVariables.add(toBeAdd);   
      }
    }
    else if (tcgOCLAtomConstraint.getElement() instanceof Property) {  //class property
      Property oProp = (Property) tcgOCLAtomConstraint.getElement();

      //Add property
      TCGVariable toBeAdd = new TCGVariable();
      if(oProp.getDefaultValue() != null)
        toBeAdd.setInitialValue(oProp.getDefaultValue().stringValue());
      toBeAdd.setName(oProp.getName());
      toBeAdd.setType(typeOfProperty(oProp.getType()));
      toBeAdd.setIsParameter(false);
      if(toBeAdd.getType() != null && !AllVariables.contains(toBeAdd))
        AllVariables.add(toBeAdd);
    }   
  }
View Full Code Here

Examples of org.xilaew.atg.model.activityTestCaseGraph.TCGVariable

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public NotificationChain basicSetVariable(TCGVariable newVariable, NotificationChain msgs) {
    TCGVariable oldVariable = variable;
    variable = newVariable;
    if (eNotificationRequired()) {
      ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, ActivityTestCaseGraphPackage.TCGOCL_VARIABLE_CALL_EXP__VARIABLE, oldVariable, newVariable);
      if (msgs == null) msgs = notification; else msgs.add(notification);
    }
View Full Code Here

Examples of org.xilaew.atg.model.activityTestCaseGraph.TCGVariable

  }

  @Override
  public String caseTCGOCLVariableCallExp(TCGOCLVariableCallExp object) {
    StringBuilder result = new StringBuilder();
    TCGVariable var = object.getVariable();
    result.append(var.getName());
    if (!var.isIsParameter()) {
      result.append("[i");
      if (object.isIsPre()) {
        result.append("-1");
      }
      result.append("]");
View Full Code Here

Examples of org.xilaew.atg.model.activityTestCaseGraph.TCGVariable

      sb.append("reset data;\n");
      sb.append("data " + filename + i + ".dat;\n");
      sb.append("solve;\n");
      sb.append("display ");
      Iterator<TCGVariable> it = tcgActivity.getVariables().iterator();
      TCGVariable var;
      while (it.hasNext()) {
        var = it.next();
        sb.append(var.getName() + (it.hasNext() ? ", " : ";\n"));
      }
    }
    return sb.toString();
  }
View Full Code Here

Examples of org.xilaew.atg.model.activityTestCaseGraph.TCGVariable

  protected AbstractTCGElement handleParameter(Parameter umlParameter) {
    // XXX maybe one could make a difference between Variables and
    // Parameters, since OCL semantic says Parameters are Immutable within
    // an activity.
    Type umlType = umlParameter.getType();
    TCGVariable tcgVar = null;
    TCGBasicVariableType tcgType = null;
    tcgType = TCGBasicVariableType.getByName(umlType.getName());
    if (tcgType != null) {
      tcgVar = factory.createTCGBasicVariable();
      ((TCGBasicVariable) tcgVar).setVariableType(tcgType);
    } else {
      tcgVar = factory.createTCGVariable();
      // TODO recurse into object type Variables.
    }
    tcgVar.setUsage(UMLHelper.getUsage(umlParameter));
    tcgVar.setIsParameter(true);
    tcgVar.setName(umlParameter.getName());
    tcgActivity.getVariables().add(tcgVar);
    return tcgVar;
  }
View Full Code Here

Examples of org.xilaew.atg.model.activityTestCaseGraph.TCGVariable

    return tcgVar;
  }

  protected AbstractTCGElement handleProperty(Property umlProperty) {
    Type umlType = umlProperty.getType();
    TCGVariable tcgVar = null;
    TCGBasicVariableType tcgType = null;
    tcgType = TCGBasicVariableType.getByName(umlType.getName());
    if (tcgType != null) {
      tcgVar = factory.createTCGBasicVariable();
      ((TCGBasicVariable) tcgVar).setVariableType(tcgType);
    } else {
      tcgVar = factory.createTCGVariable();
      // TODO recurse into object type Variables.
    }
    tcgVar.setName(umlProperty.getName());
    tcgVar.setIsParameter(false);
    tcgActivity.getVariables().add(tcgVar);
    return tcgVar;
  }
View Full Code Here

Examples of org.xilaew.atg.model.activityTestCaseGraph.TCGVariable

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setVariable(TCGVariable newVariable) {
    TCGVariable oldVariable = variable;
    variable = newVariable;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, TestsPackage.VALUE__VARIABLE, oldVariable, variable));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.