net.sf.statcvs.model
Class Commit

java.lang.Object
  extended bynet.sf.statcvs.model.Commit
All Implemented Interfaces:
Comparable

public class Commit
extends Object
implements Comparable

Represents a commit, which may consist of several CvsRevision objects. A commit means that several files were committed at once by the same author with the same message. TODO: Rename getAuthor() to getLogin(), getAffectedFiles() to getAffectedFileNames() (or change to return CvsFiles?)

Version:
$Id: Commit.java,v 1.14 2004/02/20 01:33:29 cyganiak Exp $
Author:
Richard Cyganiak

Constructor Summary
Commit(CvsRevision revision)
          Creates a new instance which consists of the given revision.
 
Method Summary
 void addRevision(CvsRevision revision)
          Adds a revision to the commit.
 int compareTo(Object other)
          Compares this commit to another revision, based on their date.
 Set getAffectedFiles()
          Returns a String Set containing all filenames which were affected by this Commit.
 Author getAuthor()
          Returns the author of the commit.
 String getComment()
          Returns the comment of the commit.
 Date getDate()
          Returns the date when the commit took place.
 Set getRevisions()
          Returns the CvsRevision objects that make up this commit.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Commit

public Commit(CvsRevision revision)
Creates a new instance which consists of the given revision.

Parameters:
revision - the single revision out of which the commit will be created
Method Detail

addRevision

public void addRevision(CvsRevision revision)
Adds a revision to the commit. The revision must be part of the commit, that is, it must have the same date, author and message as all other revisions in the commit.

Parameters:
revision - the CvsRevision to add.

getRevisions

public Set getRevisions()
Returns the CvsRevision objects that make up this commit.

Returns:
a set of CvsRevision instances

getAuthor

public Author getAuthor()
Returns the author of the commit.

Returns:
the author

getComment

public String getComment()
Returns the comment of the commit.

Returns:
the comment

getDate

public Date getDate()
Returns the date when the commit took place. The implementation simply returns the timestamp of the first change of the commit.

Returns:
a date within the timeframe of the commit

getAffectedFiles

public Set getAffectedFiles()
Returns a String Set containing all filenames which were affected by this Commit.

Returns:
a Set of Strings

compareTo

public int compareTo(Object other)
Compares this commit to another revision, based on their date.

Specified by:
compareTo in interface Comparable
See Also:
Comparable.compareTo(java.lang.Object)