Package net.sf.statcvs.input
Class CommitListBuilder
- java.lang.Object
-
- net.sf.statcvs.input.CommitListBuilder
-
public class CommitListBuilder extends java.lang.Object
Takes a set of revisions, and builds aList
ofCommit
s from it. The result list is sorted by date. The implementation allows for a tolerance of several minutes between individual file commits, but author and message must be identical.- Version:
- $Id: CommitListBuilder.java,v 1.5 2008/04/02 11:22:15 benoitx Exp $
- Author:
- Richard Cyganiak
-
-
Constructor Summary
Constructors Constructor Description CommitListBuilder(java.util.Iterator revisions)
CommitListBuilder(java.util.SortedSet revisions)
Creates a new instance using the given set ofRevision
s.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addNewCommit(Revision rev)
protected void
addRevToCommit(Commit commit, Revision rev)
java.util.List
createCommitList()
Creates aList
ofCommit
s from the source iterator.static boolean
isInTimeFrame(Commit commit, java.util.Date date)
Returnstrue
if the date lies within the timespan of the commit, plus/minus a tolerance.static boolean
isSameCommit(Commit commit, Revision rev)
Returnstrue
if change is part of the commit, that is if they have the same author, the same message, and are within the same timeframe.protected void
processRevision(Revision rev)
-
-
-
Constructor Detail
-
CommitListBuilder
public CommitListBuilder(java.util.SortedSet revisions)
Creates a new instance using the given set ofRevision
s. The set must be sorted by date, oldest first.- Parameters:
revisions
- a set ofRevision
s
-
CommitListBuilder
public CommitListBuilder(java.util.Iterator revisions)
-
-
Method Detail
-
createCommitList
public java.util.List createCommitList()
Creates aList
ofCommit
s from the source iterator. The result list will be sorted by date.- Returns:
- a new list of
Commit
objects
-
processRevision
protected void processRevision(Revision rev)
-
addNewCommit
protected void addNewCommit(Revision rev)
-
isSameCommit
public static boolean isSameCommit(Commit commit, Revision rev)
Returnstrue
if change is part of the commit, that is if they have the same author, the same message, and are within the same timeframe.- Parameters:
commit
- the commitrev
- the revision to check against this commit- Returns:
true
if change is part of this commit
-
isInTimeFrame
public static boolean isInTimeFrame(Commit commit, java.util.Date date)
Returnstrue
if the date lies within the timespan of the commit, plus/minus a tolerance.- Parameters:
date
- the date to check against this commit- Returns:
true
if the date lies within the timespan of the commit
-
-