edu.umd.cs.findbugs
Class SortedBugCollection

java.lang.Object
  extended by edu.umd.cs.findbugs.BugCollection
      extended by edu.umd.cs.findbugs.SortedBugCollection

public class SortedBugCollection
extends BugCollection

An implementation of BugCollection that keeps the BugInstances sorted by class (using the native comparison ordering of BugInstance's compareTo() method as a tie-breaker).

Author:
David Hovemeyer
See Also:
BugInstance

Nested Class Summary
private static class SortedBugCollection.BugInstanceComparator
           
 
Field Summary
private  java.util.TreeSet<BugInstance> bugSet
           
private static SortedBugCollection.BugInstanceComparator comparator
           
private  java.util.List<java.lang.String> errorList
           
private  java.util.TreeSet<java.lang.String> missingClassSet
           
private  java.lang.String summaryHTML
           
 
Fields inherited from class edu.umd.cs.findbugs.BugCollection
ANALYSIS_ERROR_ELEMENT_NAME, APP_CLASS_ELEMENT_NAME, ERRORS_ELEMENT_NAME, MISSING_CLASS_ELEMENT_NAME, PROJECT_ELEMENT_NAME, ROOT_ELEMENT_NAME, SRCMAP_ELEMENT_NAME, SUMMARY_HTML_ELEMENT_NAME
 
Constructor Summary
SortedBugCollection()
          Constructor.
 
Method Summary
 boolean add(BugInstance bugInstance)
          Add a BugInstance to this BugCollection.
 void addError(java.lang.String message)
          Add an analysis error message.
 void addMissingClass(java.lang.String message)
          Add a missing class message.
 boolean contains(BugInstance bugInstance)
           
 java.util.Iterator<java.lang.String> errorIterator()
          Return an Iterator over error messages.
 java.util.Collection<BugInstance> getCollection()
          Return the Collection storing the BugInstance objects.
 BugInstance getMatching(BugInstance bugInstance)
           
 java.lang.String getSummaryHTML()
          Get the summary HTML text.
 java.util.Iterator<BugInstance> iterator()
          Return an Iterator over all the BugInstance objects in the BugCollection.
 java.util.Iterator<java.lang.String> missingClassIterator()
          Return an Iterator over missing class messages.
 boolean remove(BugInstance bugInstance)
          Remove a BugInstance from this BugCollection.
 void setSummaryHTML(java.lang.String html)
          Set the summary HTML text.
 
Methods inherited from class edu.umd.cs.findbugs.BugCollection
addAll, readXML, readXML, readXML, toDocument, writeXML, writeXML, writeXML, writeXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

comparator

private static final SortedBugCollection.BugInstanceComparator comparator

bugSet

private java.util.TreeSet<BugInstance> bugSet

errorList

private java.util.List<java.lang.String> errorList

missingClassSet

private java.util.TreeSet<java.lang.String> missingClassSet

summaryHTML

private java.lang.String summaryHTML
Constructor Detail

SortedBugCollection

public SortedBugCollection()
Constructor. Creates an empty object.

Method Detail

add

public boolean add(BugInstance bugInstance)
Description copied from class: BugCollection
Add a BugInstance to this BugCollection.

Specified by:
add in class BugCollection
Parameters:
bugInstance - the BugInstance
Returns:
true if the BugInstance was added, or false if a matching BugInstance was already in the BugCollection

remove

public boolean remove(BugInstance bugInstance)
Description copied from class: BugCollection
Remove a BugInstance from this BugCollection.

Specified by:
remove in class BugCollection
Parameters:
bugInstance - the BugInstance
Returns:
true if the BugInstance was removed, or false if it (or an equivalent BugInstance) was not present originally

iterator

public java.util.Iterator<BugInstance> iterator()
Description copied from class: BugCollection
Return an Iterator over all the BugInstance objects in the BugCollection.

Specified by:
iterator in class BugCollection

getCollection

public java.util.Collection<BugInstance> getCollection()
Description copied from class: BugCollection
Return the Collection storing the BugInstance objects.

Specified by:
getCollection in class BugCollection

addError

public void addError(java.lang.String message)
Description copied from class: BugCollection
Add an analysis error message.

Specified by:
addError in class BugCollection
Parameters:
message - the error message

addMissingClass

public void addMissingClass(java.lang.String message)
Description copied from class: BugCollection
Add a missing class message.

Specified by:
addMissingClass in class BugCollection
Parameters:
message - the missing class message

errorIterator

public java.util.Iterator<java.lang.String> errorIterator()
Description copied from class: BugCollection
Return an Iterator over error messages.

Specified by:
errorIterator in class BugCollection

missingClassIterator

public java.util.Iterator<java.lang.String> missingClassIterator()
Description copied from class: BugCollection
Return an Iterator over missing class messages.

Specified by:
missingClassIterator in class BugCollection

contains

public boolean contains(BugInstance bugInstance)

getMatching

public BugInstance getMatching(BugInstance bugInstance)

setSummaryHTML

public void setSummaryHTML(java.lang.String html)
Description copied from class: BugCollection
Set the summary HTML text.

Specified by:
setSummaryHTML in class BugCollection

getSummaryHTML

public java.lang.String getSummaryHTML()
Description copied from class: BugCollection
Get the summary HTML text.

Specified by:
getSummaryHTML in class BugCollection