Clover coverage report - DynamicJava Test Coverage (dynamicjava-20130615-r5436)
Coverage timestamp: Sat Jun 15 2013 03:01:32 CDT
file stats: LOC: 126   Methods: 8
NCLOC: 38   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ArrayAccess.java 37.5% 66.7% 87.5% 64.7%
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    import koala.dynamicjava.tree.visitor.*;
 32   
 33    /**
 34    * This class represents the array access nodes of the syntax tree
 35    *
 36    * @author Stephane Hillion
 37    * @version 1.0 - 1999/04/24
 38    */
 39   
 40    public class ArrayAccess extends PrimaryExpression implements LeftHandSide,
 41    ExpressionContainer {
 42   
 43    /**
 44    * The expression on which this array access applies
 45    */
 46    private Expression expression;
 47   
 48    /**
 49    * The expression which denotes the cell number
 50    */
 51    private Expression cellNumber;
 52   
 53    /**
 54    * Creates a new array access node
 55    * @param exp the expression on which this array access applies
 56    * @param cell the cell number
 57    * @exception IllegalArgumentException if exp is null or cell is null
 58    */
 59  1 public ArrayAccess(Expression exp, Expression cell) {
 60  1 this(exp, cell, SourceInfo.NONE);
 61    }
 62   
 63    /**
 64    * Creates a new array access node
 65    * @param exp the expression on which this array access applies
 66    * @param cell the cell number
 67    * @exception IllegalArgumentException if exp is null or cell is null
 68    */
 69  110 public ArrayAccess(Expression exp, Expression cell,
 70    SourceInfo si) {
 71  110 super(si);
 72   
 73  0 if (exp == null) throw new IllegalArgumentException("exp == null");
 74  0 if (cell == null) throw new IllegalArgumentException("cell == null");
 75   
 76  110 expression = exp;
 77  110 cellNumber = cell;
 78    }
 79   
 80    /**
 81    * Returns the expression on which this array access applies
 82    */
 83  134 public Expression getExpression() {
 84  134 return expression;
 85    }
 86   
 87    /**
 88    * Sets the expression on which this array access applies
 89    * @exception IllegalArgumentException if e is null
 90    */
 91  0 public void setExpression(Expression e) {
 92  0 if (e == null) throw new IllegalArgumentException("e == null");
 93  0 expression = e;
 94    }
 95   
 96    /**
 97    * Returns the expression which denotes the cell number
 98    */
 99  242 public Expression getCellNumber() {
 100  242 return cellNumber;
 101    }
 102   
 103    /**
 104    * Sets the expression which denotes the cell number
 105    * @exception IllegalArgumentException if e is null
 106    */
 107  108 public void setCellNumber(Expression e) {
 108  0 if (e == null) throw new IllegalArgumentException("e == null");
 109  108 cellNumber = e;
 110    }
 111   
 112    /**
 113    * Allows a visitor to traverse the tree
 114    * @param visitor the visitor to accept
 115    */
 116  132 public <T> T acceptVisitor(Visitor<T> visitor) {
 117  132 return visitor.visit(this);
 118    }
 119   
 120    /**
 121    * Implementation of toString for use in unit testing
 122    */
 123  2 public String toString() {
 124  2 return "("+getClass().getName()+": "+getExpression()+" "+getCellNumber()+")";
 125    }
 126    }