net.sf.statcvs.model
public class VersionedFile extends Object implements Comparable
Repository
,
including its name, Directory
and Revision
list.
Revisions can be created using the addXXXRevision factory
methods. Revisions can be created in any order.
TODO: Rename class to something like VersionedFile, getCurrentLinesOfCode() to getCurrentLines(), maybe getFilenameXXX, isDead() to isDeleted()Constructor and Description |
---|
VersionedFile(String name,
Directory directory)
Creates a VersionedFile object.
|
Modifier and Type | Method and Description |
---|---|
Revision |
addBeginOfLogRevision(Date date,
int lines,
SortedSet symbolicNames)
Adds a "begin of log" revision to the file.
|
Revision |
addChangeRevision(String revisionNumber,
Author author,
Date date,
String comment,
int lines,
int linesDelta,
int replacedLines,
SortedSet symbolicNames)
Adds a change revision to the file.
|
Revision |
addDeletionRevision(String revisionNumber,
Author author,
Date date,
String comment,
int lines,
SortedSet symbolicNames)
Adds a deletion revision to the file.
|
Revision |
addInitialRevision(String revisionNumber,
Author author,
Date date,
String comment,
int lines,
SortedSet symbolicNames)
Adds an initial revision to the file.
|
int |
compareTo(Object other)
Compares this file to another one, based on filename.
|
boolean |
equals(Object rhs) |
Set |
getAuthors()
Returns a list of authors that have commited at least one revision of the file.
|
int |
getCurrentLinesOfCode()
Returns the current number of lines for this file.
|
Directory |
getDirectory()
Returns the file's Directory.
|
String |
getFilename()
Returns the filename without path.
|
String |
getFilenameWithPath()
Returns the full filename.
|
Revision |
getInitialRevision()
Gets the earliest revision of this file.
|
Revision |
getLatestRevision()
Gets the latest revision of this file.
|
Module |
getModule() |
Revision |
getPreviousRevision(Revision revision)
Returns the revision which was replaced by the revision given as
argument.
|
SortedSet |
getRevisions()
Returns the list of
Revision s of this file,
sorted from earliest to most recent. |
boolean |
hasAuthor(Author author)
Returns true, if
author worked on this file. |
int |
hashCode() |
boolean |
isDead()
Returns
true if the latest revision of this file was
a deletion. |
void |
setModule(Module module) |
String |
toString() |
public Set getAuthors()
public String getFilenameWithPath()
public String getFilename()
public Directory getDirectory()
public Revision getLatestRevision()
public Revision getInitialRevision()
public SortedSet getRevisions()
Revision
s of this file,
sorted from earliest to most recent.Revision
spublic int getCurrentLinesOfCode()
public boolean isDead()
true
if the latest revision of this file was
a deletion.true
if this file is deletedpublic boolean hasAuthor(Author author)
author
worked on this file.author
- The Author
to search fortrue
, if the author is listed in one of
this file's revisionspublic Revision getPreviousRevision(Revision revision)
revision
- a revision of this filepublic int compareTo(Object other)
compareTo
in interface Comparable
Comparable.compareTo(java.lang.Object)
public Revision addInitialRevision(String revisionNumber, Author author, Date date, String comment, int lines, SortedSet symbolicNames)
revisionNumber
- the revision number, for example "1.1"author
- the login from which the change was committeddate
- the time when the change was committedcomment
- the commit messagelines
- the number of lines of the new filepublic Revision addChangeRevision(String revisionNumber, Author author, Date date, String comment, int lines, int linesDelta, int replacedLines, SortedSet symbolicNames)
revisionNumber
- the revision number, for example "1.1"author
- the login from which the change was committeddate
- the time when the change was committedcomment
- the commit messagelines
- the number of lines in the file after the changelinesDelta
- the change in the number of linesreplacedLines
- number of lines that were removed and replaced by otherspublic Revision addDeletionRevision(String revisionNumber, Author author, Date date, String comment, int lines, SortedSet symbolicNames)
revisionNumber
- the revision number, for example "1.1"author
- the login from which the change was committeddate
- the time when the change was committedcomment
- the commit messagelines
- the number of lines in the file before it was deletedpublic Revision addBeginOfLogRevision(Date date, int lines, SortedSet symbolicNames)
date
- the begin of the loglines
- the number of lines in the file at that timepublic Module getModule()
public void setModule(Module module)