net.sf.statcvs.model
Class CvsFile

java.lang.Object
  extended bynet.sf.statcvs.model.CvsFile

public class CvsFile
extends java.lang.Object

Represents the information about one file in the source repository.

Version:
$Id: CvsFile.java,v 1.37 2003/06/03 13:00:46 cyganiak Exp $
Author:
Manuel Schulze, Richard Cyganiak

Constructor Summary
CvsFile(java.lang.String workingname, Directory directory, java.util.List revisions, boolean isBinary, boolean isInAttic)
          Creates a CvsFile object.
 
Method Summary
 int getCurrentLinesOfCode()
          Returns the number of code lines for this file. 0 will be returned for binary files and for files that are deleted.
 Directory getDirectory()
           
 java.lang.String getFilename()
          Returns the filename.
 java.lang.String getFilenameWithPath()
          Returns the workingname.
 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.
 java.util.Iterator getRevisionIterator()
          Returns an iterator over of revisions in this file.
 java.util.List getRevisions()
          Returns the list of CvsRevisions of this file, from latest to oldest.
 boolean hasAuthor(Author author)
          Returns true, if author worked on this file.
 boolean isBinary()
          Returns true if the file is checked in as a binary file.
 boolean isDead()
          Returns true if the latest revision has state dead.
 boolean isInAttic()
          Returns true if the file is in the Attic.
 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
 

Constructor Detail

CvsFile

public CvsFile(java.lang.String workingname,
               Directory directory,
               java.util.List revisions,
               boolean isBinary,
               boolean isInAttic)
Creates a CvsFile object.

Parameters:
workingname - The name of the file
directory - the directory where the file resides
revisions - the list of CvsRevisions of this file, from latest to oldest
isBinary - true if it's a binary file
isInAttic - true iff the file is dead on the main branch
Method Detail

getFilenameWithPath

public java.lang.String getFilenameWithPath()
Returns the workingname.

Returns:
String

getFilename

public java.lang.String getFilename()
Returns the filename.

Returns:
The filename.

getDirectory

public Directory getDirectory()
Returns:
the file's Directory

getLatestRevision

public CvsRevision getLatestRevision()
Gets the latest revision of this file.

Returns:
the latest revision of this file

getInitialRevision

public CvsRevision getInitialRevision()
Gets the earliest revision of this file.

Returns:
the latest revision of this file

getRevisions

public java.util.List getRevisions()
Returns the list of CvsRevisions of this file, from latest to oldest.

Returns:
A list which contains the revisions.

getCurrentLinesOfCode

public int getCurrentLinesOfCode()
Returns the number of code lines for this file. 0 will be returned for binary files and for files that are deleted.

Returns:
the number of code lines for this file.

getRevisionIterator

public java.util.Iterator getRevisionIterator()
Returns an iterator over of revisions in this file.

Returns:
An itertor over this files revisions

isDead

public boolean isDead()
Returns true if the latest revision has state dead.

Returns:
True, if this file is deleted in the repository

isBinary

public boolean isBinary()
Returns true if the file is checked in as a binary file.

Returns:
True, if this file is a binary file

hasAuthor

public boolean hasAuthor(Author author)
Returns true, if author worked on this file.

Parameters:
author - The Author to search for
Returns:
true, if the author is listed in one of this file's revisions

isInAttic

public boolean isInAttic()
Returns true if the file is in the Attic.

Returns:
true if the file is in the Attic.

getPreviousRevision

public CvsRevision getPreviousRevision(CvsRevision revision)
Returns the revision which was replaced by the revision given as argument. Returns null if the given revision is the initial revision of this file.

Parameters:
revision - a revision of this file
Returns:
this revision's predecessor

toString

public java.lang.String toString()
Returns a string representation of this objects content.

Returns:
String representation