Package net.sf.statcvs.model
Class Commit
java.lang.Object
net.sf.statcvs.model.Commit
- All Implemented Interfaces:
Comparable
Represents a commit, which may consist of several
Revision
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.17 2009/08/20 17:44:05 benoitx Exp $
- Author:
- Richard Cyganiak <richard@cyganiak.de>
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addRevision
(Revision revision) Adds a revision to the commit.int
Compares this commit to another revision, based on their date.boolean
Returns aString
Set
containing all filenames which were affected by thisCommit
.Returns the author of the commit.Returns the comment of the commit.getDate()
Returns the date when the commit took place.Returns theRevision
objects that make up this commit.int
hashCode()
-
Constructor Details
-
Commit
Creates a new instance which consists of the given revision.- Parameters:
revision
- the single revision out of which the commit will be created
-
-
Method Details
-
addRevision
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
- theRevision
to add.
-
getRevisions
Returns theRevision
objects that make up this commit.- Returns:
- a set of Revision instances
-
getAuthor
Returns the author of the commit.- Returns:
- the author
-
getComment
Returns the comment of the commit.- Returns:
- the comment
-
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
Returns aString
Set
containing all filenames which were affected by thisCommit
.- Returns:
- a
Set
ofString
s
-
compareTo
Compares this commit to another revision, based on their date.- Specified by:
compareTo
in interfaceComparable
- See Also:
-
equals
-
hashCode
public int hashCode()
-