|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.statcvs.model.VersionedFile
public class VersionedFile
Represents one versioned file in the 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 Summary | |
---|---|
VersionedFile(java.lang.String name,
Directory directory)
Creates a VersionedFile object. |
Method Summary | |
---|---|
Revision |
addBeginOfLogRevision(java.util.Date date,
int lines,
java.util.SortedSet symbolicNames)
Adds a "begin of log" revision to the file. |
Revision |
addChangeRevision(java.lang.String revisionNumber,
Author author,
java.util.Date date,
java.lang.String comment,
int lines,
int linesDelta,
int replacedLines,
java.util.SortedSet symbolicNames)
Adds a change revision to the file. |
Revision |
addDeletionRevision(java.lang.String revisionNumber,
Author author,
java.util.Date date,
java.lang.String comment,
int lines,
java.util.SortedSet symbolicNames)
Adds a deletion revision to the file. |
Revision |
addInitialRevision(java.lang.String revisionNumber,
Author author,
java.util.Date date,
java.lang.String comment,
int lines,
java.util.SortedSet symbolicNames)
Adds an initial revision to the file. |
int |
compareTo(java.lang.Object other)
Compares this file to another one, based on filename. |
java.util.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. |
java.lang.String |
getFilename()
Returns the filename without path. |
java.lang.String |
getFilenameWithPath()
Returns the full filename. |
Revision |
getInitialRevision()
Gets the earliest revision of this file. |
Revision |
getLatestRevision()
Gets the latest revision of this file. |
Revision |
getPreviousRevision(Revision revision)
Returns the revision which was replaced by the revision given as argument. |
java.util.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. |
boolean |
isDead()
Returns true if the latest revision of this file was
a deletion. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public VersionedFile(java.lang.String name, Directory directory)
name
- The full name of the filedirectory
- the directory where the file residesMethod Detail |
---|
public java.util.Set getAuthors()
public java.lang.String getFilenameWithPath()
public java.lang.String getFilename()
public Directory getDirectory()
public Revision getLatestRevision()
public Revision getInitialRevision()
public java.util.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 for
true
, if the author is listed in one of
this file's revisionspublic Revision getPreviousRevision(Revision revision)
revision
- a revision of this file
public java.lang.String toString()
toString
in class java.lang.Object
public int compareTo(java.lang.Object other)
compareTo
in interface java.lang.Comparable
Comparable.compareTo(java.lang.Object)
public Revision addInitialRevision(java.lang.String revisionNumber, Author author, java.util.Date date, java.lang.String comment, int lines, java.util.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(java.lang.String revisionNumber, Author author, java.util.Date date, java.lang.String comment, int lines, int linesDelta, int replacedLines, java.util.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(java.lang.String revisionNumber, Author author, java.util.Date date, java.lang.String comment, int lines, java.util.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(java.util.Date date, int lines, java.util.SortedSet symbolicNames)
date
- the begin of the loglines
- the number of lines in the file at that time
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |