cyvis.core.metrics.sources
Class MetricSource

java.lang.Object
  extended by cyvis.core.metrics.sources.MetricSource
Direct Known Subclasses:
FileMetricSource, JarStreamMetricSource

public abstract class MetricSource
extends Object

An object from which metrics can be extracted.


Nested Class Summary
static class MetricSource.ProgressNotifier
          This is a callback mechanism by which other classes can track the progress of a metrics collection run.
static class MetricSource.UnreadableMetricSourceException
          Thrown when a MetricSource cannot be read.
static class MetricSource.UnsupportedMetricSourceException
          Thrown when an unrecognised file extension is encountered.
 
Constructor Summary
MetricSource()
           
 
Method Summary
 void collect(ProjectMetric project)
          Collects all available metrics from the source.
abstract  void collect(ProjectMetric project, MetricSource.ProgressNotifier notifier)
          Collects all available metrics from the source.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetricSource

public MetricSource()
Method Detail

collect

public void collect(ProjectMetric project)
             throws IOException
Collects all available metrics from the source.

Parameters:
project - the ProjectMetric to which the collected metrics will be ProjectMetric.add(cyvis.core.metrics.ClassMetric)ed.
Throws:
IOException

collect

public abstract void collect(ProjectMetric project,
                             MetricSource.ProgressNotifier notifier)
                      throws IOException
Collects all available metrics from the source.

Parameters:
project - the ProjectMetric to which the collected metrics will be ProjectMetric.add(cyvis.core.metrics.ClassMetric)ed.
notifier - a ProgressNotifier whose callback methods are called to indicate the progress of metric collection
Throws:
IOException