org.hackystat.sensor.ant.javancss
Class CcnData

java.lang.Object
  extended by org.hackystat.sensor.ant.javancss.CcnData

public class CcnData
extends java.lang.Object

A data structure that takes as input the list of Java files that were processed by JavaNCSS and the Functions instance that JavaNCSS produced as a result of processing. Constructs a data structure that maps the list of Java files to a string containing a list of comma-separated integers, each one representing a CCN value for one of the methods in that class. If no CCN data was found for that file, null is returned.

Author:
Philip Johnson

Constructor Summary
CcnData(java.util.List<java.io.File> files, Functions functions)
          Constructs the File2CcnList, which is a mapping from a Java file path to a list of integers representing the cyclometric complexity values found for all of its interior methods.
 
Method Summary
 java.lang.String getCcnData(java.io.File file)
          Returns a string containing a comma-separated list of CCN values for the given file, or null if no CCN data is present.
 java.util.Set<java.io.File> getFiles()
          Returns a set containing the java file paths in this CcnData instance.
 int getTotalLines(java.io.File file)
          Returns the totallines value for file, or null if not found.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CcnData

public CcnData(java.util.List<java.io.File> files,
               Functions functions)
Constructs the File2CcnList, which is a mapping from a Java file path to a list of integers representing the cyclometric complexity values found for all of its interior methods.

Parameters:
files - The Java files whose CCN numbers are to be found.
functions - The Functions object contains CCN data.
Method Detail

getCcnData

public java.lang.String getCcnData(java.io.File file)
Returns a string containing a comma-separated list of CCN values for the given file, or null if no CCN data is present.

Parameters:
file - The file whose CCN data is to be retrieved.
Returns:
The CCN data string, or null.

getTotalLines

public int getTotalLines(java.io.File file)
Returns the totallines value for file, or null if not found.

Parameters:
file - The file whose total lines we're interested in.
Returns:
The number of lines, or null.

getFiles

public java.util.Set<java.io.File> getFiles()
Returns a set containing the java file paths in this CcnData instance.

Returns:
The Java file paths with CcnData.