Clover coverage report - DynamicJava Test Coverage (dynamicjava-20120303-r5436)
Coverage timestamp: Sat Mar 3 2012 03:02:19 CST
file stats: LOC: 123   Methods: 8
NCLOC: 37   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
LabeledStatement.java 25% 50% 62.5% 47.1%
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 labeled statement nodes of the syntax tree
 35    *
 36    * @author Stephane Hillion
 37    * @version 1.0 - 1999/05/23
 38    */
 39   
 40    public class LabeledStatement extends Statement {
 41    /**
 42    * The label
 43    */
 44    private String label;
 45   
 46    /**
 47    * The statement
 48    */
 49    private Node statement;
 50   
 51    /**
 52    * Creates a new while statement
 53    * @param label the label
 54    * @param stat the statement
 55    * @exception IllegalArgumentException if label is null or stat is null
 56    */
 57  1 public LabeledStatement(String label, Node stat) {
 58  1 this(label, stat, SourceInfo.NONE);
 59    }
 60   
 61    /**
 62    * Creates a new while statement
 63    * @param label the label
 64    * @param stat the statement
 65    * @exception IllegalArgumentException if label is null or stat is null
 66    */
 67  2 public LabeledStatement(String label, Node stat,
 68    SourceInfo si) {
 69  2 super(si);
 70   
 71  0 if (label == null) throw new IllegalArgumentException("label == null");
 72  0 if (stat == null) throw new IllegalArgumentException("stat == null");
 73   
 74  2 this.label = label;
 75  2 statement = stat;
 76    }
 77   
 78    /**
 79    * Gets the label
 80    */
 81  2 public String getLabel() {
 82  2 return label;
 83    }
 84   
 85    /**
 86    * Sets the label
 87    * @exception IllegalArgumentException if e is null
 88    */
 89  0 public void setLabel(String s) {
 90  0 if (s == null) throw new IllegalArgumentException("s == null");
 91  0 label = s;
 92    }
 93   
 94    /**
 95    * Returns the statement
 96    */
 97  2 public Node getStatement() {
 98  2 return statement;
 99    }
 100   
 101    /**
 102    * Sets the statement
 103    * @exception IllegalArgumentException if n is null
 104    */
 105  0 public void setStatement(Node n) {
 106  0 if (n == null) throw new IllegalArgumentException("n == null");
 107  0 statement = n;
 108    }
 109   
 110    /**
 111    * Allows a visitor to traverse the tree
 112    * @param visitor the visitor to accept
 113    */
 114  0 public <T> T acceptVisitor(Visitor<T> visitor) {
 115  0 return visitor.visit(this);
 116    }
 117    /**
 118    * Implementation of toString for use in unit testing
 119    */
 120  2 public String toString() {
 121  2 return "("+getClass().getName()+": "+getLabel()+" "+getStatement()+")";
 122    }
 123    }