net.sf.statcvs.input
Class CommitListBuilder

java.lang.Object
  extended bynet.sf.statcvs.input.CommitListBuilder

public class CommitListBuilder
extends Object

Takes a set of revisions, and builds a List of Commits 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.2 2004/02/17 21:40:14 cyganiak Exp $
Author:
Richard Cyganiak

Constructor Summary
CommitListBuilder(SortedSet revisions)
          Creates a new instance using the given set of CvsRevisions.
 
Method Summary
protected  void addNewCommit(CvsRevision rev)
           
protected  void addRevToCommit(Commit commit, CvsRevision rev)
           
 List createCommitList()
          Creates a List of Commits from the source iterator.
static boolean isInTimeFrame(Commit commit, Date date)
          Returns true if the date lies within the timespan of the commit, plus/minus a tolerance.
static boolean isSameCommit(Commit commit, CvsRevision rev)
          Returns true 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(CvsRevision rev)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommitListBuilder

public CommitListBuilder(SortedSet revisions)
Creates a new instance using the given set of CvsRevisions. The set must be sorted by date, oldest first.

Parameters:
revisions - a set of CvsRevisions
Method Detail

createCommitList

public List createCommitList()
Creates a List of Commits from the source iterator. The result list will be sorted by date.

Returns:
a new list of Commit objects

processRevision

protected void processRevision(CvsRevision rev)

addNewCommit

protected void addNewCommit(CvsRevision rev)

addRevToCommit

protected void addRevToCommit(Commit commit,
                              CvsRevision rev)

isSameCommit

public static boolean isSameCommit(Commit commit,
                                   CvsRevision rev)
Returns true 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 commit
rev - the revision to check against this commit
Returns:
true if change is part of this commit

isInTimeFrame

public static boolean isInTimeFrame(Commit commit,
                                    Date date)
Returns true 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