ca.utoronto.JCVSReport.metric
Class RegexMatchCounter
java.lang.Object
ca.utoronto.JCVSReport.metric.BasicMetric
ca.utoronto.JCVSReport.metric.RegexMatchCounter
- All Implemented Interfaces:
- Metric
- Direct Known Subclasses:
- RegexLineCounter, SyntaxTreeRegexMatchCounter
- public class RegexMatchCounter
- extends BasicMetric
Metric: Gather one metric from a revision of a file and add it to the Bloof
database
- Author:
- David James, Olga Rodimina
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RegexMatchCounter
public RegexMatchCounter()
init
public void init(MetricDatabase database,
String id,
ResourceBundle props)
throws Exception
- Initialize Metric from properties file
- Specified by:
init
in interface Metric
- Overrides:
init
in class BasicMetric
- Parameters:
database
- Where to insert the metricsid
- The id number of the metricprops
- The properties of this metric as specified in the
.properties file
- Throws:
Exception
processRevision
public void processRevision(String revisionId,
String contents)
throws Exception
- Process the contents of a revision of a file with this metric
- Parameters:
revisionId
- A unique ID for this revision of this filecontents
- The contents of the file as a string
- Throws:
Exception
countMatches
public int countMatches(String contents,
Pattern regex)
- Returns number of matches for a specified regular expression
- Parameters:
contents
- The contents of the file as a stringregex
- regular expression to match
JCVSReport: Easy Progress Reports for CVS/Java Projects. By David James.