net.sf.statcvs.input

Class RevisionData


public class RevisionData
extends Object

Container for all information contained in one CVS revisionNumber
Version:
$Id: RevisionData.java,v 1.7 2008/04/02 11:22:15 benoitx Exp $
Author:
Richard Cyganiak

Method Summary

String
getComment()
Date
getDate()
int
getLinesAdded()
int
getLinesRemoved()
String
getLoginName()
String
getRevisionNumber()
boolean
hasNoLines()
Checks if the revision contains numbers for the added and removed lines.
boolean
isAddOnSubbranch()
Returns true if this revisionNumber marks the adding of a new file on a subbranch.
boolean
isChangeOrRestore()
Returns true if this revisionNumber is a normal change, or if it restores a removed file.
boolean
isCreation()
Returns true if this revisionNumber is the creation of a new file.
boolean
isDeletion()
Returns true if this revisionNumber is the removal of a file.
boolean
isOnTrunk()
Returns true if this revisionNumber is on the main branch.
boolean
isStateDead()
Returns true if this is a dead revisionNumber.
boolean
isStateExp()
Returns true if this is an Exp revisionNumber.
void
setComment(String comment)
void
setDate(Date date)
void
setLines(int added, int removed)
Sets the number of added and removed lines.
void
setLoginName(String authorName)
void
setRevisionNumber(String revision)
Sets the revision number.
void
setStateDead()
void
setStateExp()
String
toString()

Method Details

getComment

public String getComment()
Returns:
Returns the comment.

getDate

public Date getDate()
Returns:
Returns the date.

getLinesAdded

public int getLinesAdded()
Returns:
Returns the linesAdded.

getLinesRemoved

public int getLinesRemoved()
Returns:
Returns the linesRemoved.

getLoginName

public String getLoginName()
Returns:
Returns the loginName.

getRevisionNumber

public String getRevisionNumber()
Returns:
Returns the revisionNumber.

hasNoLines

public boolean hasNoLines()
Checks if the revision contains numbers for the added and removed lines.
Returns:
true if the revision contains numbers for the added and removed lines

isAddOnSubbranch

public boolean isAddOnSubbranch()
Returns true if this revisionNumber marks the adding of a new file on a subbranch. CVS creates a dead 1.1 revisionNumber on the trunk even if the file never gets merged into the trunk. If we evaluate the trunk, and the file doesn't have any other revisions on the trunk, then we ignore this revisionNumber.
Returns:
true if this is the adding of a new file on a subbranch

isChangeOrRestore

public boolean isChangeOrRestore()
Returns true if this revisionNumber is a normal change, or if it restores a removed file. The distinction between these two cases can be made by looking at the previous (in time, not log order) revisionNumber. If it was a deletion, then this revisionNumber is a restore.
Returns:
true if this is a normal change or a restore.

isCreation

public boolean isCreation()
Returns true if this revisionNumber is the creation of a new file.
Returns:
true if this is the creation of a new file.

isDeletion

public boolean isDeletion()
Returns true if this revisionNumber is the removal of a file. Any dead revisionNumber means that the file was removed. The only exception is a dead 1.1 revisionNumber, which is an add on a subbranch.
Returns:
true if this revisionNumber deletes the file.

isOnTrunk

public boolean isOnTrunk()
Returns true if this revisionNumber is on the main branch.
Returns:
true if this revisionNumber is on the main branch.

isStateDead

public boolean isStateDead()
Returns true if this is a dead revisionNumber. If this is the current revisionNumber, then the file does not exist in the working copy.
Returns:
true if this is a dead revisionNumber

isStateExp

public boolean isStateExp()
Returns true if this is an Exp revisionNumber. This is CVS speak for any "live" revisionNumber, that is, if this is the current revisionNumber, then a file exists in the working copy.
Returns:
true if this is an Exp revisionNumber

setComment

public void setComment(String comment)
Parameters:
comment - The comment to set.

setDate

public void setDate(Date date)
Parameters:
date - The date to set.

setLines

public void setLines(int added,
                     int removed)
Sets the number of added and removed lines.
Parameters:
added - The number of added lines
removed - The number of removed lines

setLoginName

public void setLoginName(String authorName)
Parameters:
authorName - The loginName to set.

setRevisionNumber

public void setRevisionNumber(String revision)
Sets the revision number.
Parameters:
revision - The revision number

setStateDead

public void setStateDead()

setStateExp

public void setStateExp()

toString

public String toString()