cyvis.core.metrics.sources
Class JarStreamMetricSource

java.lang.Object
  extended by cyvis.core.metrics.sources.MetricSource
      extended by cyvis.core.metrics.sources.JarStreamMetricSource

public class JarStreamMetricSource
extends MetricSource

Supports collecting metrics from a .jar file for which we only have an input stream (but not a File on disk). In this case we can't give very sensible progress notifications, but we try anyway.

JarFileMetricSource is used if we have a file on disk, because it gives accurate progress notifications.


Nested Class Summary
 
Nested classes/interfaces inherited from class cyvis.core.metrics.sources.MetricSource
MetricSource.ProgressNotifier, MetricSource.UnreadableMetricSourceException, MetricSource.UnsupportedMetricSourceException
 
Field Summary
protected  InputStream stream
           
 
Constructor Summary
JarStreamMetricSource(InputStream stream)
           
 
Method Summary
 void collect(ProjectMetric project, MetricSource.ProgressNotifier notifier)
          Collects all available metrics from the source.
 
Methods inherited from class cyvis.core.metrics.sources.MetricSource
collect
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

stream

protected InputStream stream
Constructor Detail

JarStreamMetricSource

public JarStreamMetricSource(InputStream stream)
Method Detail

collect

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

Specified by:
collect in class MetricSource
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