Clover coverage report - DynamicJava Test Coverage (dynamicjava-20110903-r5436)
Coverage timestamp: Sat Sep 3 2011 03:02:20 CDT
file stats: LOC: 103   Methods: 6
NCLOC: 30   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
BinaryExpression.java 50% 75% 100% 73.3%
coverage coverage
 1    /*
 2    * DynamicJava - Copyright (C) 1999-2001
 3    *
 4    * Permission is hereby granted, free of charge, to any person obtaining a
 5    * copy of this software and associated documentation files
 6    * (the "Software"), to deal in the Software without restriction, including
 7    * without limitation the rights to use, copy, modify, merge, publish,
 8    * distribute, sublicense, and/or sell copies of the Software, and to permit
 9    * persons to whom the Software is furnished to do so, subject to the
 10    * following conditions:
 11    * The above copyright notice and this permission notice shall be included
 12    * in all copies or substantial portions of the Software.
 13    *
 14    * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 15    * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 16    * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 17    * IN NO EVENT SHALL DYADE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 18    * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 19    * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 20    * DEALINGS IN THE SOFTWARE.
 21    *
 22    * Except as contained in this notice, the name of Dyade shall not be
 23    * used in advertising or otherwise to promote the sale, use or other
 24    * dealings in this Software without prior written authorization from
 25    * Dyade.
 26    *
 27    */
 28   
 29    package koala.dynamicjava.tree;
 30   
 31    /**
 32    * This class represents the binary expression nodes of the syntax tree
 33    *
 34    * @author Stephane Hillion
 35    * @version 1.0 - 1999/04/25
 36    */
 37   
 38    public abstract class BinaryExpression extends Expression {
 39    /**
 40    * The LHS expression
 41    */
 42    private Expression leftExpression;
 43   
 44    /**
 45    * The RHS expression
 46    */
 47    private Expression rightExpression;
 48   
 49    /**
 50    * Initializes the expression
 51    * @param lexp the LHS expression
 52    * @param rexp the RHS expression
 53    * @exception IllegalArgumentException if lexp is null or rexp is null
 54    */
 55  575 protected BinaryExpression(Expression lexp, Expression rexp,
 56    SourceInfo si) {
 57  575 super(si);
 58   
 59  0 if (lexp == null) throw new IllegalArgumentException("lexp == null");
 60  0 if (rexp == null) throw new IllegalArgumentException("rexp == null");
 61   
 62  575 leftExpression = lexp;
 63  575 rightExpression = rexp;
 64    }
 65   
 66    /**
 67    * Returns the left hand side expression
 68    */
 69  2074 public Expression getLeftExpression() {
 70  2074 return leftExpression;
 71    }
 72   
 73    /**
 74    * Sets the left hand side expression
 75    * @exception IllegalArgumentException if exp is null
 76    */
 77  322 public void setLeftExpression(Expression exp) {
 78  0 if (exp == null) throw new IllegalArgumentException("exp == null");
 79  322 leftExpression = exp;
 80    }
 81   
 82    /**
 83    * Returns the right hand side expression
 84    */
 85  1537 public Expression getRightExpression() {
 86  1537 return rightExpression;
 87    }
 88   
 89    /**
 90    * Sets the right hand side expression
 91    * @exception IllegalArgumentException if exp is null
 92    */
 93  549 public void setRightExpression(Expression exp) {
 94  0 if (exp == null) throw new IllegalArgumentException("exp == null");
 95  549 rightExpression = exp;
 96    }
 97    /**
 98    * Implementation of toString for use in unit testing
 99    */
 100  18 public String toString() {
 101  18 return "("+getClass().getName()+": "+getLeftExpression()+" "+getRightExpression()+")";
 102    }
 103    }