Package expression.logical

Examples of expression.logical.AndExpression


    return result;
  }
 
  private static void addConjunct(LogicalExpression e,ArrayList<LogicalExpression> result){
    if (e instanceof AndExpression) {
      AndExpression a = (AndExpression)e;
      addConjunct((LogicalExpression)((AndExpression)a).arg1(),
          result);
      addConjunct((LogicalExpression)((AndExpression)e).arg2(),
          result);
    }
View Full Code Here


    }
    // a=>b is (not a or b) so returns return (a and not b)
    else if (e instanceof ImpliesExpression){
      Expression a1 = ((ImpliesExpression)e).arg1();
      LogicalExpression a2 = (LogicalExpression)((ImpliesExpression)e).arg2();
      return new AndExpression(a1,negateCase(a2));
    }
    // returns the negation
    else return new NotExpression(e);
  }
View Full Code Here

    LogicalExpression first = parse(next,p);
    if (!child.hasMoreChild()) exception(1);
    LogicalExpression second = logicalOperatorAux(child,p, operator);
    LogicalExpression result = null;
    if (isOr(operator))result = new OrExpression(first,second);
    else if (isAnd(operator)) result = new AndExpression(first,second);
    return result;
  }
View Full Code Here

    LogicalExpression first = parse(next,p);
    result = first;
    if (child.hasMoreChild()) {
      LogicalExpression second = logicalOperatorAux(child,p,op);
      if (isOr(op)) result = new OrExpression(first,second);
      else if (isAnd(op))result = new AndExpression(first,second);
      return result;
    }
    return first;
  }
View Full Code Here

TOP

Related Classes of expression.logical.AndExpression

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.