cyvis.core.metrics.sources
Class FileMetricSource
java.lang.Object
cyvis.core.metrics.sources.MetricSource
cyvis.core.metrics.sources.FileMetricSource
- Direct Known Subclasses:
- ClassFileMetricSource, JarFileMetricSource, TextFileMetricSource
public abstract class FileMetricSource
- extends MetricSource
A file from which metrics can be extracted.
Field Summary |
protected File |
file
The file from which metrics are to be extracted. |
Method Summary |
static FileMetricSource |
get(File fileName)
Factory method for constructing the appropriate FileMetricSource for a
given filename. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
file
protected final File file
- The file from which metrics are to be extracted.
FileMetricSource
public FileMetricSource(File file)
get
public static FileMetricSource get(File fileName)
throws RuntimeException
- Factory method for constructing the appropriate FileMetricSource for a
given filename.
- Returns:
- an instance of a FileMetricSource subclass which can be used to
extract metrics from the given filename
- Throws:
UnreadableMetricSourceException
- if the file cannot be read
UnsupportedMetricSourceException
- if the file extension is not recognised
RuntimeException