edu.umd.cs.findbugs

Class PackageStats

public class PackageStats extends Object implements XMLWriteable

Class to store package bug statistics.

Author: Mike Fagan Jay Dunning

Nested Class Summary
static classPackageStats.ClassStats
Field Summary
static intALL_ERRORS
static StringELEMENT_NAME
Constructor Summary
PackageStats(String packageName)
Method Summary
voidaddClass(String name, boolean isInterface, int size)
voidaddClass(String name, String sourceFile, boolean isInterface, int size)
voidaddError(BugInstance bug)
voidclearBugCounts()
intgetBugsAtPriority(int p)
Collection<PackageStats.ClassStats>getClassStats()
PackageStats.ClassStatsgetClassStatsOrNull(String name)
StringgetPackageName()
intgetTotalBugs()
voidrecomputeFromClassStats()
intsize()
static voidwriteBugPriorities(XMLOutput xmlOutput, int[] bugs)
Add priority attributes to a started tag.
voidwriteXML(XMLOutput xmlOutput)

Field Detail

ALL_ERRORS

public static final int ALL_ERRORS

ELEMENT_NAME

public static final String ELEMENT_NAME

Constructor Detail

PackageStats

public PackageStats(String packageName)

Method Detail

addClass

public void addClass(String name, boolean isInterface, int size)

Deprecated: Use PackageStats instead

addClass

public void addClass(String name, String sourceFile, boolean isInterface, int size)

addError

public void addError(BugInstance bug)

clearBugCounts

public void clearBugCounts()

getBugsAtPriority

public int getBugsAtPriority(int p)

getClassStats

public Collection<PackageStats.ClassStats> getClassStats()

getClassStatsOrNull

public PackageStats.ClassStats getClassStatsOrNull(String name)

getPackageName

public String getPackageName()

getTotalBugs

public int getTotalBugs()

recomputeFromClassStats

public void recomputeFromClassStats()

size

public int size()

writeBugPriorities

public static void writeBugPriorities(XMLOutput xmlOutput, int[] bugs)
Add priority attributes to a started tag. Each priority at offset n, where n > 0, is output using attribute priority_n if the value at offset n is greater than zero.

Parameters: xmlOutput an output stream for which startTag has been called but stopTag has not. bugs an array for which the element at offset n is the number of bugs for priority n.

writeXML

public void writeXML(XMLOutput xmlOutput)
FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.