|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.statcvs.model.CvsRevision
Object which contains information about one revision of a file.
Everytime an author checks his code into a repository the revision number he was working on, is incremented. Revision numbers have an odd number of periods. And on each forked revision an even integer is appended to the original revision (e.g. Rev 1.3 forks to 1.3.2.1 :-). The 0 is not used for revision numbering. It has a special meaning in the cvs branching mechanism. These are the so called "magic branches".
TODO: Make this class immutable (no setters, fat constructor) and give linesAdded, linesRemoved and linesOfCode intuitive semantics (and not the strange semantics of cvs log)
Field Summary | |
static int |
STATE_DEAD
state constant for dead (deleted) revisions |
static int |
STATE_INITIAL_REVISION
state constant which marks an initial release of a file |
static int |
STATE_NORMAL
state constant for normal revisions |
static int |
STATE_RE_ADDED
state constant which marks a re-add of a previously deleted file |
Constructor Summary | |
CvsRevision(java.lang.String revision)
Creates a new revision of a file with the specified revision number. |
Method Summary | |
Author |
getAuthor()
Returns the author |
java.lang.String |
getComment()
Returns the comment. |
java.util.Date |
getDate()
Returns the date. |
int |
getEffectiveLinesOfCode()
Returns the lines of code value for this revision. |
CvsFile |
getFile()
Returns the CvsFile object of this revision. |
int |
getFileCountChange()
Returns the change of the file count caused by this revision. |
int |
getLinesAdded()
Returns the number of added lines. |
int |
getLinesOfCode()
Returns the lines of code value for this revision. |
int |
getLinesOfCodeChange()
Returns by how many lines the line count changed with this revision. |
int |
getLinesRemoved()
Returns the number of removed lines. |
int |
getLineValue()
Returns the lines of code value of this revision. |
CvsRevision |
getPreviousRevision()
Returns the predecessor of this revision or null if it is the first revision. |
int |
getRemovingValue()
Returns the lines of code removing value of this revision. |
java.lang.String |
getRevision()
Returns the revision number. |
boolean |
isDead()
|
boolean |
isInitialRevision()
Returns true if this is the first revision for |
boolean |
isReAdd()
Returns TRUE if Revision is re-added, FALSE otherwise |
void |
setAuthor(Author author)
Sets the author. |
void |
setComment(java.lang.String comment)
Sets the comment. |
protected void |
setCvsFile(CvsFile file)
Sets the CvsFile which the revision belongs to.
|
void |
setDate(java.util.Date date)
Sets the date. |
void |
setLinesAdded(int linesadded)
Sets the number of added lines. |
void |
setLinesOfCode(int linesOfCode)
Sets the lines of code value for this revision. |
void |
setLinesRemoved(int linesremoved)
Sets the number of removed lines. |
void |
setState(int state)
Sets the state flag of this revision. |
java.lang.String |
toString()
Returns a string representation of this objects content. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int STATE_INITIAL_REVISION
public static final int STATE_NORMAL
public static final int STATE_DEAD
public static final int STATE_RE_ADDED
Constructor Detail |
public CvsRevision(java.lang.String revision)
revision
- revision number, for example "1.1"Method Detail |
protected void setCvsFile(CvsFile file)
CvsFile
which the revision belongs to.
Called by CvsFile.CvsFile(java.lang.String, net.sf.statcvs.model.Directory, java.util.List, boolean, boolean)
.
file
- CvsFile that belongs to this revisionpublic java.lang.String getRevision()
public Author getAuthor()
public java.lang.String getComment()
public java.util.Date getDate()
public int getLinesAdded()
public int getLinesRemoved()
public void setState(int state)
STATE_XXX
constants.
state
- the state of this revisionpublic void setAuthor(Author author)
author
- The author to setpublic void setComment(java.lang.String comment)
comment
- The comment to setpublic void setDate(java.util.Date date)
date
- The date to setpublic void setLinesAdded(int linesadded)
linesadded
- The linesadded to setpublic void setLinesRemoved(int linesremoved)
linesremoved
- The linesremoved to setpublic void setLinesOfCode(int linesOfCode)
linesOfCode
- the number of code linespublic int getLinesOfCode()
public int getEffectiveLinesOfCode()
public int getLinesOfCodeChange()
getLinesOfCode()
,
re-adds and initial revisions return getLinesOfCode()
.
public int getFileCountChange()
public boolean isInitialRevision()
true
if this is the first revision for
true
if this is the first revision for
this file.public boolean isReAdd()
public boolean isDead()
true
if the file is deleted in this revisionpublic java.lang.String toString()
public CvsFile getFile()
CvsFile
object of this revision.
CvsFile
object of this revision.public int getLineValue()
public int getRemovingValue()
public CvsRevision getPreviousRevision()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |