net.sourceforge.pmd.rules.codesize
Class AbstractNcssCount

java.lang.Object
  extended by net.sourceforge.pmd.CommonAbstractRule
      extended by net.sourceforge.pmd.AbstractJavaRule
          extended by net.sourceforge.pmd.stat.StatisticalRule
              extended by net.sourceforge.pmd.rules.codesize.AbstractNcssCount
All Implemented Interfaces:
JavaParserVisitor, Rule
Direct Known Subclasses:
NcssConstructorCount, NcssMethodCount, NcssTypeCount

public abstract class AbstractNcssCount
extends StatisticalRule

Abstract superclass for NCSS counting methods. Counts tokens according to JavaNCSS rules.

Author:
Jason Bennett

Field Summary
 
Fields inherited from class net.sourceforge.pmd.stat.StatisticalRule
DELTA
 
Fields inherited from interface net.sourceforge.pmd.Rule
LOWEST_PRIORITY, PRIORITIES
 
Constructor Summary
protected AbstractNcssCount(java.lang.Class nodeClass)
          Count the nodes of the given type using NCSS rules.
 
Method Summary
protected  java.lang.Integer countNodeChildren(SimpleJavaNode node, java.lang.Object data)
          Count the number of children of the given Java node.
 java.lang.Object visit(ASTBreakStatement node, java.lang.Object data)
           
 java.lang.Object visit(ASTCatchStatement node, java.lang.Object data)
           
 java.lang.Object visit(ASTContinueStatement node, java.lang.Object data)
           
 java.lang.Object visit(ASTDoStatement node, java.lang.Object data)
           
 java.lang.Object visit(ASTFinallyStatement node, java.lang.Object data)
           
 java.lang.Object visit(ASTForStatement node, java.lang.Object data)
           
 java.lang.Object visit(ASTIfStatement node, java.lang.Object data)
           
 java.lang.Object visit(ASTLabeledStatement node, java.lang.Object data)
           
 java.lang.Object visit(ASTLocalVariableDeclaration node, java.lang.Object data)
           
 java.lang.Object visit(ASTReturnStatement node, java.lang.Object data)
           
 java.lang.Object visit(ASTStatementExpression node, java.lang.Object data)
           
 java.lang.Object visit(ASTSwitchLabel node, java.lang.Object data)
           
 java.lang.Object visit(ASTSwitchStatement node, java.lang.Object data)
           
 java.lang.Object visit(ASTSynchronizedStatement node, java.lang.Object data)
           
 java.lang.Object visit(ASTThrowStatement node, java.lang.Object data)
           
 java.lang.Object visit(ASTWhileStatement node, java.lang.Object data)
           
 java.lang.Object visit(SimpleJavaNode node, java.lang.Object data)
           
 
Methods inherited from class net.sourceforge.pmd.stat.StatisticalRule
addDataPoint, apply, applyMinimumValue, applyTopScore, getMean, getStdDev, makeViolations, propertiesByName
 
Methods inherited from class net.sourceforge.pmd.AbstractJavaRule
addViolation, addViolation, addViolation, addViolationWithMessage, getDeclaringType, importsPackage, isQualifiedName, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visitAll
 
Methods inherited from class net.sourceforge.pmd.CommonAbstractRule
addExample, addProperties, addProperty, addRuleChainVisit, asFixedMap, asFixedMap, end, equals, getBooleanProperties, getBooleanProperty, getBooleanProperty, getDescription, getDoubleProperties, getDoubleProperty, getDoubleProperty, getExample, getExamples, getExternalInfoUrl, getIntProperties, getIntProperty, getIntProperty, getMessage, getName, getPriority, getPriorityName, getProperties, getRuleChainVisits, getRuleClass, getRuleSetName, getSince, getStringProperties, getStringProperty, getStringProperty, getTypeProperties, getTypeProperty, hashCode, hasProperty, include, propertyDescriptorFor, setDescription, setExternalInfoUrl, setInclude, setMessage, setName, setPriority, setProperties, setProperty, setRuleClass, setRuleSetName, setSince, setUsesDFA, setUsesTypeResolution, start, usesDFA, usesRuleChain, usesTypeResolution
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractNcssCount

protected AbstractNcssCount(java.lang.Class nodeClass)
Count the nodes of the given type using NCSS rules.

Parameters:
nodeClass - class of node to count
Method Detail

visit

public java.lang.Object visit(SimpleJavaNode node,
                              java.lang.Object data)
Specified by:
visit in interface JavaParserVisitor
Overrides:
visit in class AbstractJavaRule

countNodeChildren

protected java.lang.Integer countNodeChildren(SimpleJavaNode node,
                                              java.lang.Object data)
Count the number of children of the given Java node. Adds one to count the node itself.

Parameters:
node - java node having children counted
data - node data
Returns:
count of the number of children of the node, plus one

visit

public java.lang.Object visit(ASTForStatement node,
                              java.lang.Object data)
Specified by:
visit in interface JavaParserVisitor
Overrides:
visit in class AbstractJavaRule

visit

public java.lang.Object visit(ASTDoStatement node,
                              java.lang.Object data)
Specified by:
visit in interface JavaParserVisitor
Overrides:
visit in class AbstractJavaRule

visit

public java.lang.Object visit(ASTIfStatement node,
                              java.lang.Object data)
Specified by:
visit in interface JavaParserVisitor
Overrides:
visit in class AbstractJavaRule

visit

public java.lang.Object visit(ASTWhileStatement node,
                              java.lang.Object data)
Specified by:
visit in interface JavaParserVisitor
Overrides:
visit in class AbstractJavaRule

visit

public java.lang.Object visit(ASTBreakStatement node,
                              java.lang.Object data)
Specified by:
visit in interface JavaParserVisitor
Overrides:
visit in class AbstractJavaRule

visit

public java.lang.Object visit(ASTCatchStatement node,
                              java.lang.Object data)
Specified by:
visit in interface JavaParserVisitor
Overrides:
visit in class AbstractJavaRule

visit

public java.lang.Object visit(ASTContinueStatement node,
                              java.lang.Object data)
Specified by:
visit in interface JavaParserVisitor
Overrides:
visit in class AbstractJavaRule

visit

public java.lang.Object visit(ASTFinallyStatement node,
                              java.lang.Object data)
Specified by:
visit in interface JavaParserVisitor
Overrides:
visit in class AbstractJavaRule

visit

public java.lang.Object visit(ASTReturnStatement node,
                              java.lang.Object data)
Specified by:
visit in interface JavaParserVisitor
Overrides:
visit in class AbstractJavaRule

visit

public java.lang.Object visit(ASTSwitchStatement node,
                              java.lang.Object data)
Specified by:
visit in interface JavaParserVisitor
Overrides:
visit in class AbstractJavaRule

visit

public java.lang.Object visit(ASTSynchronizedStatement node,
                              java.lang.Object data)
Specified by:
visit in interface JavaParserVisitor
Overrides:
visit in class AbstractJavaRule

visit

public java.lang.Object visit(ASTThrowStatement node,
                              java.lang.Object data)
Specified by:
visit in interface JavaParserVisitor
Overrides:
visit in class AbstractJavaRule

visit

public java.lang.Object visit(ASTStatementExpression node,
                              java.lang.Object data)
Specified by:
visit in interface JavaParserVisitor
Overrides:
visit in class AbstractJavaRule

visit

public java.lang.Object visit(ASTLabeledStatement node,
                              java.lang.Object data)
Specified by:
visit in interface JavaParserVisitor
Overrides:
visit in class AbstractJavaRule

visit

public java.lang.Object visit(ASTLocalVariableDeclaration node,
                              java.lang.Object data)
Specified by:
visit in interface JavaParserVisitor
Overrides:
visit in class AbstractJavaRule

visit

public java.lang.Object visit(ASTSwitchLabel node,
                              java.lang.Object data)
Specified by:
visit in interface JavaParserVisitor
Overrides:
visit in class AbstractJavaRule


Copyright © 2002-2011 InfoEther. All Rights Reserved.