com.hammurapi.review
Class Aggregator

java.lang.Object
  extended by com.hammurapi.review.Aggregator
All Implemented Interfaces:
ObservationSink
Direct Known Subclasses:
ModuleAggregator, Summary

public class Aggregator
extends Object
implements ObservationSink

Aggregates violations by severity and inspector and measurements by name into metrics.

Author:
Pavel Vlasov

Nested Class Summary
static class Aggregator.InspectorEntry
           
static class Aggregator.Metric
           
static class Aggregator.Severity
           
 
Constructor Summary
Aggregator()
           
Aggregator(LanguageElement languageElement)
          Aggregates findings reported by the given language element and its children.
 
Method Summary
 void close()
          Closes this observation sink.
 void consumeObservation(Observation observation)
          Consumes review observation.
 Collection<Aggregator.Metric> getMetrics()
           
 Collection<Aggregator.Severity> getSeverities()
           
 List<Warning> getWarnings()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Aggregator

public Aggregator()

Aggregator

public Aggregator(LanguageElement languageElement)
           throws ReviewException
Aggregates findings reported by the given language element and its children.

Parameters:
languageElement -
Throws:
ReviewException
Method Detail

close

public void close()
           throws ReviewException
Description copied from interface: ObservationSink
Closes this observation sink.

Specified by:
close in interface ObservationSink
Throws:
ReviewException

consumeObservation

public void consumeObservation(Observation observation)
                        throws ReviewException
Description copied from interface: ObservationSink
Consumes review observation.

Specified by:
consumeObservation in interface ObservationSink
Throws:
ReviewException

getSeverities

public Collection<Aggregator.Severity> getSeverities()

getMetrics

public Collection<Aggregator.Metric> getMetrics()

getWarnings

public List<Warning> getWarnings()