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