|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.statcvs.model.CvsFile
Represents one versioned file in the Repository
,
including its name, Directory
and CvsRevision
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 | |
CvsFile(String name,
Directory directory)
Creates a CvsFile object. |
Method Summary | |
CvsRevision |
addBeginOfLogRevision(Date date,
int lines)
Adds a "begin of log" revision to the file. |
CvsRevision |
addChangeRevision(String revisionNumber,
Author author,
Date date,
String comment,
int lines,
int linesDelta,
int replacedLines)
Adds a change revision to the file. |
CvsRevision |
addDeletionRevision(String revisionNumber,
Author author,
Date date,
String comment,
int lines)
Adds a deletion revision to the file. |
CvsRevision |
addInitialRevision(String revisionNumber,
Author author,
Date date,
String comment,
int lines)
Adds an initial revision to the file. |
int |
compareTo(Object other)
Compares this file to another one, based on filename. |
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. |
CvsRevision |
getInitialRevision()
Gets the earliest revision of this file. |
CvsRevision |
getLatestRevision()
Gets the latest revision of this file. |
CvsRevision |
getPreviousRevision(CvsRevision revision)
Returns the revision which was replaced by the revision given as argument. |
SortedSet |
getRevisions()
Returns the list of CvsRevision 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. |
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public CvsFile(String name, Directory directory)
name
- The full name of the filedirectory
- the directory where the file residesMethod Detail |
public String getFilenameWithPath()
public String getFilename()
public Directory getDirectory()
public CvsRevision getLatestRevision()
public CvsRevision getInitialRevision()
public SortedSet getRevisions()
CvsRevision
s of this file,
sorted from earliest to most recent.
CvsRevision
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 CvsRevision getPreviousRevision(CvsRevision revision)
revision
- a revision of this file
public String toString()
public int compareTo(Object other)
compareTo
in interface Comparable
Comparable.compareTo(java.lang.Object)
public CvsRevision addInitialRevision(String revisionNumber, Author author, Date date, String comment, int lines)
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 CvsRevision addChangeRevision(String revisionNumber, Author author, Date date, String comment, int lines, int linesDelta, int replacedLines)
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 CvsRevision addDeletionRevision(String revisionNumber, Author author, Date date, String comment, int lines)
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 CvsRevision addBeginOfLogRevision(Date date, int lines)
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 |