Clover coverage report - PMD - 3.3
Coverage timestamp: Thu Sep 15 2005 17:59:57 EDT
file stats: LOC: 72   Methods: 9
NCLOC: 52   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
ASTFieldDeclaration.java 33.3% 52% 88.9% 54.3%
coverage coverage
 1    /* Generated By:JJTree: Do not edit this line. ASTFieldDeclaration.java */
 2   
 3    package net.sourceforge.pmd.ast;
 4   
 5    public class ASTFieldDeclaration extends AccessNode implements Dimensionable {
 6   
 7  1 public ASTFieldDeclaration(int id) {
 8  1 super(id);
 9    }
 10   
 11  311 public ASTFieldDeclaration(JavaParser p, int id) {
 12  311 super(p, id);
 13    }
 14   
 15    /**
 16    * Accept the visitor. *
 17    */
 18  717 public Object jjtAccept(JavaParserVisitor visitor, Object data) {
 19  717 return visitor.visit(this, data);
 20    }
 21   
 22  3 public boolean isArray() {
 23  3 return checkType() + checkDecl() > 0;
 24    }
 25   
 26  2 public int getArrayDepth() {
 27  2 if (!isArray()) {
 28  0 return 0;
 29    }
 30  2 return checkType() + checkDecl();
 31    }
 32   
 33  5 private int checkType() {
 34  5 if (jjtGetNumChildren() == 0 || !(jjtGetChild(0) instanceof ASTType)) {
 35  0 return 0;
 36    }
 37  5 return ((ASTType) jjtGetChild(0)).getArrayDepth();
 38    }
 39   
 40  5 private int checkDecl() {
 41  5 if (jjtGetNumChildren() < 2 || !(jjtGetChild(1) instanceof ASTVariableDeclarator)) {
 42  0 return 0;
 43    }
 44  5 return ((ASTVariableDeclaratorId) (jjtGetChild(1).jjtGetChild(0))).getArrayDepth();
 45    }
 46   
 47  0 public void dump(String prefix) {
 48  0 String out = collectDumpedModifiers(prefix);
 49  0 if (isArray()) {
 50  0 out += "(array";
 51  0 for (int i = 0; i < getArrayDepth(); i++) {
 52  0 out += "[";
 53    }
 54  0 out += ")";
 55    }
 56  0 System.out.println(out);
 57  0 dumpChildren(prefix);
 58    }
 59   
 60    /**
 61    * Gets the variable name of this field.
 62    * This method searches the first VariableDeclartorId node and returns it's image or <code>null</code> if the child node is not found.
 63    * @return a String representing the name of the variable
 64    */
 65  9 public String getVariableName() {
 66  9 ASTVariableDeclaratorId decl = (ASTVariableDeclaratorId) getFirstChildOfType(ASTVariableDeclaratorId.class);
 67  9 if (decl!=null) {
 68  9 return decl.getImage();
 69    }
 70  0 return null;
 71    }
 72    }