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