Examples of TCGOCLOperation


Examples of net.sf.parteg.base.testcasegraph.generated.TCGOCLOperation

  {
    if(in_oExp != null) {
      in_oVisitor.check(in_oExp);
      if(in_oExp instanceof TCGOCLOperation)
      {
        TCGOCLOperation oOpExp = (TCGOCLOperation)in_oExp;
        if(oOpExp.getLeft() != null)
          run(oOpExp.getLeft(), in_oVisitor);
        if(oOpExp.getRight() != null)
          run(oOpExp.getRight(), in_oVisitor);     
      }
      else if(in_oExp instanceof TCGOCLIfThenElse) {
        TCGOCLIfThenElse oIfThenElseExp = (TCGOCLIfThenElse)in_oExp;
        if(oIfThenElseExp.getCondition() != null)
          run(oIfThenElseExp.getCondition(), in_oVisitor);
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGOCLOperation

 
  private void buildMapForClassification(TCGOCLExpression in_oExpression)
  {
    if(in_oExpression instanceof TCGOCLOperation)
    {
      TCGOCLOperation oOperation = (TCGOCLOperation)in_oExpression;
      buildMapForClassification(oOperation.getLeft());
      buildMapForClassification(oOperation.getRight());
    }
    if(in_oExpression instanceof TCGOCLAtom)
    {
      TCGOCLAtom oAtom = (TCGOCLAtom)in_oExpression;
      m_colExpressionClassification.get(oAtom.getClassification()).add(oAtom);
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGOCLOperation

    {
      return ((TCGOCLAtom)in_oOCLExpression).getElement().equals(in_oReferencedObject);
    }
    else if(in_oOCLExpression instanceof TCGOCLOperation)
    {
      TCGOCLOperation oOpExp = (TCGOCLOperation)in_oOCLExpression;
      return conditionContainsReferenceToObject(oOpExp.getLeft(), in_oReferencedObject) ||
        conditionContainsReferenceToObject(oOpExp.getRight(), in_oReferencedObject);
    }
    else if(in_oOCLExpression instanceof TCGOCLIfThenElse)
    {
      TCGOCLIfThenElse oIfThenElseExp = (TCGOCLIfThenElse)in_oOCLExpression;
      return conditionContainsReferenceToObject(oIfThenElseExp.getCondition(), in_oReferencedObject) ||
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGOCLOperation

  public static String toString(TCGOCLExpression in_oExpression)
  {
    StringBuffer sRetValue = new StringBuffer("");
    if(in_oExpression instanceof TCGOCLOperation)
    {
      TCGOCLOperation oOp = (TCGOCLOperation)in_oExpression;
      if(oOp.getOperationName().equals("not")) {
        TCGOCLExpression oNonNullExp = oOp.getLeft();
        if(oNonNullExp == null)
          oNonNullExp = oOp.getRight();
        sRetValue.append("(not " + toString(oNonNullExp));
      }
      else
        sRetValue.append("(" + toString(oOp.getLeft()) +
          " " + oOp.getOperationName() + " " +
          toString(oOp.getRight()) + ")");
    }
    else if(in_oExpression instanceof TCGOCLAtom)
    {
      TCGOCLAtom oAtom = (TCGOCLAtom)in_oExpression;
      if(oAtom.getElement() instanceof BooleanLiteralExp) {
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGOCLOperation

 
  public static boolean isBooleanOperation(TCGOCLExpression in_oExpression)
  {
    if(in_oExpression instanceof TCGOCLOperation)
    {
      TCGOCLOperation oOperation = (TCGOCLOperation)in_oExpression;
      return oOperation.getOperationName().equals("and") ||
        oOperation.getOperationName().equals("or") ||
        oOperation.getOperationName().equals("not");
    }
    return false;
  }
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGOCLOperation

 
  public static boolean isComparisonOperation(TCGOCLExpression in_oExpression)
  {
    if(in_oExpression instanceof TCGOCLOperation)
    {
      TCGOCLOperation oOperation = (TCGOCLOperation)in_oExpression;
      return oOperation.getOperationName().equals("<") ||
        oOperation.getOperationName().equals("<=") ||
        oOperation.getOperationName().equals(">") ||
        oOperation.getOperationName().equals(">=") ||
        oOperation.getOperationName().equals("=") ||
        oOperation.getOperationName().equals("<>");
    }
    return false;   
  }
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGOCLOperation

      }
      else if(in_oExpression instanceof TCGOCLOperation)
      {
        in_oExpression = TCGOCLExpressionHelperClass.removeDoubleNots(in_oExpression);
       
        TCGOCLOperation oOldOperation = (TCGOCLOperation)in_oExpression;
        TCGOCLOperation oNewOperation = GeneratedFactory.eINSTANCE.createTCGOCLOperation();
        oNewOperation.setOperation(oOldOperation.getOperation());
        oNewOperation.setOperationName(oOldOperation.getOperationName());
        oNewOperation.setLeft(changeExpressionAccordingToDecisionTableRow(
            oOldOperation.getLeft(), in_oRow, out_oRow));
        oNewOperation.setRight(changeExpressionAccordingToDecisionTableRow(
            oOldOperation.getRight(), in_oRow, out_oRow));
        oTCGOCLExpression = oNewOperation;
      }
      else if(in_oExpression instanceof TCGOCLIfThenElse)
      {
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGOCLOperation

  }
 
  public static TCGOCLExpression removeDoubleNots(TCGOCLExpression in_oExpression)
  {
    if(in_oExpression instanceof TCGOCLOperation) {
      TCGOCLOperation oOpExp = (TCGOCLOperation)in_oExpression;
      if(oOpExp.getOperationName().equals("not")) {
        TCGOCLExpression oNegatedOp = oOpExp.getLeft();
        if(oNegatedOp == null)
          oNegatedOp = oOpExp.getRight();
       
        if(oNegatedOp instanceof TCGOCLOperation) {
          TCGOCLOperation oPositiveOp = (TCGOCLOperation)oNegatedOp;
          if(oPositiveOp.getOperationName().equals("not")) {
            TCGOCLExpression oFinalExp = oPositiveOp.getLeft();
            if(oFinalExp == null)
              oFinalExp = oPositiveOp.getRight();
           
            return removeDoubleNots(oFinalExp);
          }
        }
      }
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGOCLOperation

  }
 
  public static TCGOCLExpression pushDownNots(TCGOCLExpression in_oExpression)
  {
    if(in_oExpression instanceof TCGOCLOperation) {
      TCGOCLOperation oOpExp = (TCGOCLOperation)in_oExpression;
      TCGOCLExpression oLeftOrRightExp =
        TCGOCLExpressionHelperClass.getNonNullLeftOrRight(oOpExp);
      if(oOpExp.getOperationName().equals("not") &&
          !TCGOCLExpressionHelperClass.isBooleanAtom(oLeftOrRightExp)) {
        return TCGOCLExpressionHelperClass.negateLogicalTCGOCLExpression(
            oLeftOrRightExp);
      }
      oOpExp.setLeft(pushDownNots(oOpExp.getLeft()));
      oOpExp.setRight(pushDownNots(oOpExp.getRight()));
    }
    return in_oExpression;
  }
View Full Code Here

Examples of net.sf.parteg.base.testcasegraph.generated.TCGOCLOperation

   */
  public static boolean expressionIsContradicting(TCGOCLOperation in_oExpression)
  {
    // TODO: implement a checker operation to return the type of an expression (boolean, int, double)
    try { // double?
      TCGOCLOperation oOperation = (TCGOCLOperation)in_oExpression;
      double nLeftValue = TCGOCLExpressionHelperClass.getDoubleValue(oOperation.getLeft());
      double nRightValue = TCGOCLExpressionHelperClass.getDoubleValue(oOperation.getRight());
      if((oOperation.getOperationName().compareTo("<") == 0) && (nLeftValue >= nRightValue))
        return true;
      if((oOperation.getOperationName().compareTo("<=") == 0) && (nLeftValue > nRightValue))
        return true;
      if((oOperation.getOperationName().compareTo("=") == 0) && (nLeftValue != nRightValue))
        return true;
      if((oOperation.getOperationName().compareTo(">=") == 0) && (nLeftValue < nRightValue))
        return true;
      if((oOperation.getOperationName().compareTo(">") == 0) && (nLeftValue <= nRightValue))
        return true;
      if((oOperation.getOperationName().compareTo("<>") == 0) && (nLeftValue == nRightValue))
        return true;
    }
    catch(Exception e)
    {
      // nothing ...
      try { // int?
        TCGOCLOperation oOperation = (TCGOCLOperation)in_oExpression;
        int nLeftValue = TCGOCLExpressionHelperClass.getIntegerValue(oOperation.getLeft());
        int nRightValue = TCGOCLExpressionHelperClass.getIntegerValue(oOperation.getRight());
        if((oOperation.getOperationName().compareTo("<") == 0) && (nLeftValue >= nRightValue))
          return true;
        if((oOperation.getOperationName().compareTo("<=") == 0) && (nLeftValue > nRightValue))
          return true;
        if((oOperation.getOperationName().compareTo("=") == 0) && (nLeftValue != nRightValue))
          return true;
        if((oOperation.getOperationName().compareTo(">=") == 0) && (nLeftValue < nRightValue))
          return true;
        if((oOperation.getOperationName().compareTo(">") == 0) && (nLeftValue <= nRightValue))
          return true;
        if((oOperation.getOperationName().compareTo("<>") == 0) && (nLeftValue == nRightValue))
          return true;
      }
      catch(Exception e1) {
        // nothing ...
        try { // boolean?
          TCGOCLOperation oOperation = (TCGOCLOperation)in_oExpression;
          boolean nLeftValue = TCGOCLExpressionHelperClass.getBooleanValueIfNegative(oOperation.getLeft());
          boolean nRightValue = TCGOCLExpressionHelperClass.getBooleanValueIfNegative(oOperation.getRight());
          if((oOperation.getOperationName().compareTo("=") == 0) && (nLeftValue != nRightValue))
            return true;
          if((oOperation.getOperationName().compareTo("<>") == 0) && (nLeftValue == nRightValue))
            return true;
        }
        catch(Exception e2) {
         
          // nothing ... but an error message
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.