net.sf.statcvs.model

Class Repository


public class Repository
extends Object

Represents a CVS Repository and provides access to the VersionedFiles, Directorys, Revisions and Authors recorded in the repository's history. TODO: Rename class to Repository, getCurrentLOC to getCurrentLines, getAuthors to getLogins TODO: Change getCommits to SortedSet
Version:
$Id: Repository.java,v 1.3 2008/04/02 11:22:16 benoitx Exp $
Authors:
Manuel Schulze
Tammo van Lessen
Richard Cyganiak

Method Summary

void
addFile(VersionedFile file)
Adds one file to the repository.
SortedSet
getAuthors()
Returns a SortedSet of all Authors who have committed to the repository, sorted by name.
List
getCommits()
Returns a List of all Commits.
int
getCurrentLOC()
returns the current line count of the repository
SortedSet
getDirectories()
Returns a SortedSet of all Directory objects in the repository, ordered in tree order
SortedSet
getFiles()
Returns a list of all VersionedFiles, ordered by full name
Date
getFirstDate()
Returns the first Date when there were changes on the repository.
SymbolicName
getHead()
A special symbolic name that contains the latest revision of every file.
Date
getLastDate()
Returns the latest Date when there were changes on the repository.
SortedSet
getRevisions()
Returns a SortedSet of Revisions in the repository, sorted from oldest to most recent.
Directory
getRoot()
Returns the repository's root directory, or null if the directory contains no files.
SortedSet
getSymbolicNames()
Returns a list of SymbolicNames, ordered from latest to oldest.
boolean
isEmpty()
Returns true if the repository contains no files.
void
setCommits(List commits)
Sets the list of commits.
void
setSymbolicNames(SortedSet symbolicNames)
Sets the list of symbolic names contained in this Repository.
String
toString()

Method Details

addFile

public void addFile(VersionedFile file)
Adds one file to the repository.
Parameters:
file - the file

getAuthors

public SortedSet getAuthors()
Returns a SortedSet of all Authors who have committed to the repository, sorted by name.
Returns:
a SortedSet of Authors

getCommits

public List getCommits()
Returns:
all commits

getCurrentLOC

public int getCurrentLOC()
returns the current line count of the repository
Returns:
the current line count of the repository

getDirectories

public SortedSet getDirectories()
Returns a SortedSet of all Directory objects in the repository, ordered in tree order
Returns:
a collection of Directory objects

getFiles

public SortedSet getFiles()
Returns a list of all VersionedFiles, ordered by full name
Returns:
a list of all VersionedFiles

getFirstDate

public Date getFirstDate()
Returns the first Date when there were changes on the repository.
Returns:
The first Date

getHead

public SymbolicName getHead()
A special symbolic name that contains the latest revision of every file.

getLastDate

public Date getLastDate()
Returns the latest Date when there were changes on the repository.
Returns:
The latest Date

getRevisions

public SortedSet getRevisions()
Returns a SortedSet of Revisions in the repository, sorted from oldest to most recent.
Returns:
all revisions in the repository.

getRoot

public Directory getRoot()
Returns the repository's root directory, or null if the directory contains no files.
Returns:
the root directory

getSymbolicNames

public SortedSet getSymbolicNames()
Returns a list of SymbolicNames, ordered from latest to oldest.

isEmpty

public boolean isEmpty()
Returns true if the repository contains no files.
Returns:
true if the repository is empty

setCommits

public void setCommits(List commits)
Sets the list of commits. This method exists only because of stupid design. This method may only be called by stupid designers. TODO: Fix this ugly hack!
Parameters:
commits - the list of commits

setSymbolicNames

public void setSymbolicNames(SortedSet symbolicNames)
Sets the list of symbolic names contained in this Repository.
Parameters:
symbolicNames -

toString

public String toString()