|
|||||||||||
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 a developer 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".
Field Summary | |
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 String. |
Method Summary | |
java.lang.String |
getAuthor()
Returns the author. |
java.lang.String |
getBranchName()
Returns the branch name of the file. |
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 |
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 if this is the head revision it returns the lines of code otherwise it returns the number of added lines in this revision |
java.lang.String |
getRevision()
Returns the revision. |
boolean |
isDead()
|
boolean |
isInitialRevision()
Returns true if this is the first revision for |
boolean |
isOnMainBranch()
Returns true if this revision is part of the main branch,
and false if it is part of a side branch. |
boolean |
isReAdd()
Returns TRUE if Revision is re-added, FALSE otherwise |
void |
setAuthor(java.lang.String author)
Sets the author. |
void |
setBranchName(java.lang.String branch)
Sets the branch of the revision. |
void |
setComment(java.lang.String comment)
Sets the comment. |
protected void |
setCvsFile(CvsFile file)
Sets the CvsFile for the revision. |
void |
setDate(java.util.Date date)
Sets the date. |
void |
setIsDead(boolean isDead)
Mark a dead file (which is currently deleted). |
void |
setLines(int added,
int removed)
Convenience method for setting both added and removed lines. |
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_NORMAL
public static final int STATE_INITIAL_REVISION
public static final int STATE_RE_ADDED
Constructor Detail |
public CvsRevision(java.lang.String revision)
revision
- revision numberMethod Detail |
protected void setCvsFile(CvsFile file)
CvsFile
for the revision. Called by CvsFile
.
file
- CvsFile that belongs to this revisionpublic java.lang.String getAuthor()
public java.lang.String getComment()
public java.util.Date getDate()
public int getLinesAdded()
public int getLinesRemoved()
public java.lang.String getRevision()
public java.lang.String getBranchName()
null
for the main branchpublic void setState(int state)
STATE_XXX
constants.
state
- the state of this revisionpublic void setIsDead(boolean isDead)
isDead
- the live status of the revisionpublic void setAuthor(java.lang.String 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 setBranchName(java.lang.String branch)
null
is the main branch.
branch
- the name of a branchpublic void setLinesAdded(int linesadded)
linesadded
- The linesadded to setpublic void setLinesRemoved(int linesremoved)
linesremoved
- The linesremoved to setpublic void setLines(int added, int removed)
added
- the number of added linesremoved
- the number of removed linespublic 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 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 boolean isOnMainBranch()
true
if this revision is part of the main branch,
and false
if it is part of a side branch. This information
is extracted from the revision number. Revisions like 1.1 and 5.212 are
on the main branch, 1.1.1.1 and 1.4.2.13 and 1.4.2.13.4.1 are on side
branches.
true
if this revision is part of the main branch.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |