Clover coverage report - DynamicJava Test Coverage (dynamicjava-20120303-r5436)
Coverage timestamp: Sat Mar 3 2012 03:02:19 CST
file stats: LOC: 97   Methods: 6
NCLOC: 26   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
TypeExpression.java 25% 63.6% 83.3% 61.9%
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 type expression nodes of the syntax tree
 35    *
 36    * @author Stephane Hillion
 37    * @version 1.0 - 1999/04/24
 38    */
 39   
 40    public class TypeExpression extends PrimaryExpression {
 41    /**
 42    * The type represented by this expression
 43    */
 44    private TypeName type;
 45   
 46    /**
 47    * Initializes the expression
 48    * @param t the type represented by this expression
 49    * @exception IllegalArgumentException if t is null
 50    */
 51  2 public TypeExpression(TypeName t) {
 52  2 this(t, SourceInfo.NONE);
 53    }
 54   
 55    /**
 56    * Initializes the expression
 57    * @param t the type represented by this expression
 58    * @exception IllegalArgumentException if t is null
 59    */
 60  18 public TypeExpression(TypeName t, SourceInfo si) {
 61  18 super(si);
 62   
 63  0 if (t == null) throw new IllegalArgumentException("t == null");
 64   
 65  18 type = t;
 66    }
 67   
 68    /**
 69    * Returns the type represented by this expression
 70    */
 71  52 public TypeName getType() {
 72  52 return type;
 73    }
 74   
 75    /**
 76    * Sets the type
 77    * @exception IllegalArgumentException if t is null
 78    */
 79  0 public void setType(ReferenceTypeName t) {
 80  0 if (t == null) throw new IllegalArgumentException("t == null");
 81  0 type = t;
 82    }
 83   
 84    /**
 85    * Allows a visitor to traverse the tree
 86    * @param visitor the visitor to accept
 87    */
 88  27 public <T> T acceptVisitor(Visitor<T> visitor) {
 89  27 return visitor.visit(this);
 90    }
 91    /**
 92    * Implementation of toString for use in unit testing
 93    */
 94  4 public String toString() {
 95  4 return "("+getClass().getName()+": "+getType()+")";
 96    }
 97    }