Clover coverage report - Java Language Levels Test Coverage (javalanglevels-20120305-r5436)
Coverage timestamp: Sun Mar 4 2012 22:02:46 CST
file stats: LOC: 122   Methods: 9
NCLOC: 80   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
InitializedVariableDeclarator.java 25% 50% 44.4% 43.5%
coverage coverage
 1    package edu.rice.cs.javalanglevels.tree;
 2   
 3    import edu.rice.cs.javalanglevels.SourceInfo;
 4   
 5    /**
 6    * Class InitializedVariableDeclarator, 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 InitializedVariableDeclarator extends VariableDeclarator {
 11    private final VariableInitializerI _initializer;
 12   
 13    /**
 14    * Constructs a InitializedVariableDeclarator.
 15    * @throws java.lang.IllegalArgumentException If any parameter to the constructor is null.
 16    */
 17  127 public InitializedVariableDeclarator(SourceInfo in_sourceInfo, Type in_type, Word in_name, VariableInitializerI in_initializer) {
 18  127 super(in_sourceInfo, in_type, in_name);
 19   
 20  127 if (in_initializer == null) {
 21  0 throw new java.lang.IllegalArgumentException("Parameter 'initializer' to the InitializedVariableDeclarator constructor was null. This class may not have null field values.");
 22    }
 23  127 _initializer = in_initializer;
 24    }
 25   
 26  283 final public VariableInitializerI getInitializer() { return _initializer; }
 27   
 28  124 public <RetType> RetType visit(JExpressionIFVisitor<RetType> visitor) { return visitor.forInitializedVariableDeclarator(this); }
 29  0 public void visit(JExpressionIFVisitor_void visitor) { visitor.forInitializedVariableDeclarator(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  90 public void outputHelp(TabPrintWriter writer) {
 49  90 writer.print("InitializedVariableDeclarator" + ":");
 50  90 writer.indent();
 51   
 52  90 writer.startLine("");
 53  90 writer.print("sourceInfo = ");
 54  90 SourceInfo temp_sourceInfo = getSourceInfo();
 55  90 if (temp_sourceInfo == null) {
 56  0 writer.print("null");
 57    } else {
 58  90 writer.print(temp_sourceInfo);
 59    }
 60   
 61  90 writer.startLine("");
 62  90 writer.print("type = ");
 63  90 Type temp_type = getType();
 64  90 if (temp_type == null) {
 65  0 writer.print("null");
 66    } else {
 67  90 temp_type.outputHelp(writer);
 68    }
 69   
 70  90 writer.startLine("");
 71  90 writer.print("name = ");
 72  90 Word temp_name = getName();
 73  90 if (temp_name == null) {
 74  0 writer.print("null");
 75    } else {
 76  90 temp_name.outputHelp(writer);
 77    }
 78   
 79  90 writer.startLine("");
 80  90 writer.print("initializer = ");
 81  90 VariableInitializerI temp_initializer = getInitializer();
 82  90 if (temp_initializer == null) {
 83  0 writer.print("null");
 84    } else {
 85  90 temp_initializer.outputHelp(writer);
 86    }
 87  90 writer.unindent();
 88    }
 89   
 90    /**
 91    * Implementation of equals that is based on the values
 92    * of the fields of the object. Thus, two objects
 93    * created with identical parameters will be equal.
 94    */
 95  0 public boolean equals(java.lang.Object obj) {
 96  0 if (obj == null) return false;
 97  0 if ((obj.getClass() != this.getClass()) || (obj.hashCode() != this.hashCode())) {
 98  0 return false;
 99    } else {
 100  0 InitializedVariableDeclarator casted = (InitializedVariableDeclarator) obj;
 101  0 if (! (getType().equals(casted.getType()))) return false;
 102  0 if (! (getName().equals(casted.getName()))) return false;
 103  0 if (! (getInitializer().equals(casted.getInitializer()))) return false;
 104  0 return true;
 105    }
 106    }
 107   
 108    /**
 109    * Implementation of hashCode that is consistent with
 110    * equals. The value of the hashCode is formed by
 111    * XORing the hashcode of the class object with
 112    * the hashcodes of all the fields of the object.
 113    */
 114  0 protected int generateHashCode() {
 115  0 int code = getClass().hashCode();
 116  0 code ^= 0;
 117  0 code ^= getType().hashCode();
 118  0 code ^= getName().hashCode();
 119  0 code ^= getInitializer().hashCode();
 120  0 return code;
 121    }
 122    }