Clover coverage report - Java Language Levels Test Coverage (javalanglevels-20120305-r5436)
Coverage timestamp: Sun Mar 4 2012 22:02:46 CST
file stats: LOC: 118   Methods: 10
NCLOC: 76   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
LabeledStatement.java 27.8% 51% 50% 45.6%
coverage coverage
 1    package edu.rice.cs.javalanglevels.tree;
 2   
 3    import edu.rice.cs.javalanglevels.SourceInfo;
 4   
 5    /**
 6    * Class LabeledStatement, a component of the JExpressionIF composite hierarchy.
 7    * Note: null is not allowed as a value for any field.
 8    * @version Generated automatically by ASTGen at Sun Mar 04 22:01:28 CST 2012
 9    */
 10    public class LabeledStatement extends Statement {
 11    private final Word _label;
 12    private final Statement _statement;
 13   
 14    /**
 15    * Constructs a LabeledStatement.
 16    * @throws java.lang.IllegalArgumentException If any parameter to the constructor is null.
 17    */
 18  3 public LabeledStatement(SourceInfo in_sourceInfo, Word in_label, Statement in_statement) {
 19  3 super(in_sourceInfo);
 20   
 21  3 if (in_label == null) {
 22  0 throw new java.lang.IllegalArgumentException("Parameter 'label' to the LabeledStatement constructor was null. This class may not have null field values.");
 23    }
 24  3 _label = in_label;
 25   
 26  3 if (in_statement == null) {
 27  0 throw new java.lang.IllegalArgumentException("Parameter 'statement' to the LabeledStatement constructor was null. This class may not have null field values.");
 28    }
 29  3 _statement = in_statement;
 30    }
 31   
 32  4 final public Word getLabel() { return _label; }
 33  4 final public Statement getStatement() { return _statement; }
 34   
 35  2 public <RetType> RetType visit(JExpressionIFVisitor<RetType> visitor) { return visitor.forLabeledStatement(this); }
 36  0 public void visit(JExpressionIFVisitor_void visitor) { visitor.forLabeledStatement(this); }
 37   
 38    /**
 39    * Implementation of toString that uses
 40    * {@link #output} to generated nicely tabbed tree.
 41    */
 42  0 public java.lang.String toString() {
 43  0 java.io.StringWriter w = new java.io.StringWriter();
 44  0 output(w);
 45  0 return w.toString();
 46    }
 47   
 48    /**
 49    * Prints this object out as a nicely tabbed tree.
 50    */
 51  0 public void output(java.io.Writer writer) {
 52  0 outputHelp(new TabPrintWriter(writer, 2));
 53    }
 54   
 55  2 public void outputHelp(TabPrintWriter writer) {
 56  2 writer.print("LabeledStatement" + ":");
 57  2 writer.indent();
 58   
 59  2 writer.startLine("");
 60  2 writer.print("sourceInfo = ");
 61  2 SourceInfo temp_sourceInfo = getSourceInfo();
 62  2 if (temp_sourceInfo == null) {
 63  0 writer.print("null");
 64    } else {
 65  2 writer.print(temp_sourceInfo);
 66    }
 67   
 68  2 writer.startLine("");
 69  2 writer.print("label = ");
 70  2 Word temp_label = getLabel();
 71  2 if (temp_label == null) {
 72  0 writer.print("null");
 73    } else {
 74  2 temp_label.outputHelp(writer);
 75    }
 76   
 77  2 writer.startLine("");
 78  2 writer.print("statement = ");
 79  2 Statement temp_statement = getStatement();
 80  2 if (temp_statement == null) {
 81  0 writer.print("null");
 82    } else {
 83  2 temp_statement.outputHelp(writer);
 84    }
 85  2 writer.unindent();
 86    }
 87   
 88    /**
 89    * Implementation of equals that is based on the values
 90    * of the fields of the object. Thus, two objects
 91    * created with identical parameters will be equal.
 92    */
 93  0 public boolean equals(java.lang.Object obj) {
 94  0 if (obj == null) return false;
 95  0 if ((obj.getClass() != this.getClass()) || (obj.hashCode() != this.hashCode())) {
 96  0 return false;
 97    } else {
 98  0 LabeledStatement casted = (LabeledStatement) obj;
 99  0 if (! (getLabel().equals(casted.getLabel()))) return false;
 100  0 if (! (getStatement().equals(casted.getStatement()))) return false;
 101  0 return true;
 102    }
 103    }
 104   
 105    /**
 106    * Implementation of hashCode that is consistent with
 107    * equals. The value of the hashCode is formed by
 108    * XORing the hashcode of the class object with
 109    * the hashcodes of all the fields of the object.
 110    */
 111  0 protected int generateHashCode() {
 112  0 int code = getClass().hashCode();
 113  0 code ^= 0;
 114  0 code ^= getLabel().hashCode();
 115  0 code ^= getStatement().hashCode();
 116  0 return code;
 117    }
 118    }