Package org.eclipse.ocl.uml

Examples of org.eclipse.ocl.uml.Variable


 
  @SuppressWarnings("rawtypes")
  public static String oclAtomConstraintToAMPL(TCGOCLAtomImpl tcgOCLAtomConstraint){
    StringBuilder result = new StringBuilder();
   
    Variable oVar = null;
    if (tcgOCLAtomConstraint.getElement() instanceof Variable) {  //input parameter
      oVar = (Variable)tcgOCLAtomConstraint.getElement();
      if (oVar != null) {
        result.append(oVar.getName());
      }   
    }
    else if (tcgOCLAtomConstraint.getElement() instanceof Property) {  //class property
      Property oProp = (Property) tcgOCLAtomConstraint.getElement();
      result.append(oProp.getName());
View Full Code Here


        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

  }

  public static String oclAtomConstraintVisitor(TCGOCLAtomImpl tcgOCLAtomConstraint){
    StringBuilder result = new StringBuilder();
   
    Variable oVar = null;
    if (tcgOCLAtomConstraint.getElement() instanceof Variable) {  //input parameter
      oVar = (Variable)tcgOCLAtomConstraint.getElement();
      if (oVar != null) {
        result.append(oVar.getName());
        if(oVar.getType().getName().equalsIgnoreCase("Integer"))
          result.append(".intValue()");
        if(oVar.getType().getName().equalsIgnoreCase("Real"))
          result.append(".floatValue()");
      }
    }
    else if (tcgOCLAtomConstraint.getElement() instanceof Property) {  //class property
      Property oProp = (Property) tcgOCLAtomConstraint.getElement();
View Full Code Here

      EObject oSecondObject = in_oSecondAtom.getElement();
      if (oFirstObject.equals(oSecondObject))
        return true;
      if(oFirstObject instanceof Variable &&
          oSecondObject instanceof Variable) {
        Variable oFirstVariable = (Variable)oFirstObject;
        Variable oSecondVariable = (Variable)oSecondObject;
        if(oFirstVariable.getRepresentedParameter().equals(
            oSecondVariable.getRepresentedParameter())) {
          return true;
        }
      }
    }
//    else if ((in_oFirstAtom.getElement() instanceof PropertyCallExp) &&
View Full Code Here

  }
 
  public static EObject getReferencedElement(TCGOCLAtom in_oAtom)
  {
    if(in_oAtom.getElement() instanceof Variable) {
      Variable oVariable = (Variable)in_oAtom.getElement();
      if(oVariable.getRepresentedParameter() != null)
        return oVariable.getRepresentedParameter();
      return in_oAtom.getElement();
    }
    else if (in_oAtom.getElement() instanceof Property) {
      return in_oAtom.getElement();
    }
View Full Code Here

   */ 
  public static double getDoubleValue(TCGOCLExpression in_oTCGOCLExpression)
      throws Exception {
    if (in_oTCGOCLExpression instanceof TCGOCLAtom) {
      TCGOCLAtom oPropExp = (TCGOCLAtom) in_oTCGOCLExpression;
      Variable oVar = null;
      if (oPropExp.getElement() instanceof Variable) {
        oVar = (Variable)oPropExp.getElement();
      }
 
      if (oVar != null) {
View Full Code Here

      TCGOCLAtom oPropExp = (TCGOCLAtom) in_oTCGOCLExpression;
      if(in_colValueAssignments.keySet().contains(oPropExp)) {
        return Double.valueOf(in_colValueAssignments.get(oPropExp).getValue());
      }
     
      Variable oVar = null;
      if (oPropExp.getElement() instanceof Variable) {
        oVar = (Variable)oPropExp.getElement();
      }
 
      if (oVar != null) {
View Full Code Here

   */ 
  public static Integer getIntegerValue(TCGOCLExpression in_oTCGOCLExpression)
      throws Exception {
    if (in_oTCGOCLExpression instanceof TCGOCLAtom) {
      TCGOCLAtom oPropExp = (TCGOCLAtom) in_oTCGOCLExpression;
      Variable oVar = null;
      if (oPropExp.getElement() instanceof Variable) {
        oVar = (Variable)oPropExp.getElement();
      }
 
      if (oVar != null) {
View Full Code Here

   */
  public static boolean getBooleanValueIfNegative(TCGOCLExpression in_oTCGOCLExpression)
      throws Exception {
    if (in_oTCGOCLExpression instanceof TCGOCLAtom) {
      TCGOCLAtom oPropExp = (TCGOCLAtom) in_oTCGOCLExpression;
      Variable oVar = null;
      if (oPropExp.getElement() instanceof Variable) {
        oVar = (Variable)oPropExp.getElement();
      }
   
      if (oVar != null) {
View Full Code Here

      if(in_colCurrentValueAssignment.keySet().contains(oPropExp)) {
        return !(in_colCurrentValueAssignment.get("oPropExp").getValue()
            .equals("false"));         
      }

      Variable oVar = null;
      if (oPropExp.getElement() instanceof Variable) {
        oVar = (Variable)oPropExp.getElement();
      }
   
      if (oVar != null) {
View Full Code Here

TOP

Related Classes of org.eclipse.ocl.uml.Variable

Copyright © 2018 www.massapicom. 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.