Class Repository


  • public class Repository
    extends java.lang.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.5 2009/08/31 19:16:35 benoitx Exp $
    Author:
    Manuel Schulze, Tammo van Lessen, Richard Cyganiak
    • Constructor Summary

      Constructors 
      Constructor Description
      Repository()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addFile​(VersionedFile file)
      Adds one file to the repository.
      java.util.SortedSet getAuthors()
      Returns a SortedSet of all Authors who have committed to the repository, sorted by name.
      java.util.List getCommits()
      Returns a List of all Commits.
      int getCurrentLOC()
      returns the current line count of the repository
      java.util.SortedSet getDirectories()
      Returns a SortedSet of all Directory objects in the repository, ordered in tree order
      java.util.SortedSet getFiles()
      Returns a list of all VersionedFiles, ordered by full name
      java.util.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.
      java.util.Date getLastDate()
      Returns the latest Date when there were changes on the repository.
      java.util.SortedMap getModules()  
      java.util.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.
      java.util.SortedSet getSymbolicNames()
      Returns a list of SymbolicNames, ordered from latest to oldest.
      boolean isEmpty()
      Returns true if the repository contains no files.
      void setCommits​(java.util.List commits)
      Sets the list of commits.
      void setSymbolicNames​(java.util.SortedSet symbolicNames)
      Sets the list of symbolic names contained in this Repository.
      java.lang.String toString()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Repository

        public Repository()
    • Method Detail

      • addFile

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

        public void setCommits​(java.util.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
      • getCommits

        public java.util.List getCommits()
        Returns a List of all Commits.
        Returns:
        all commits
      • getLastDate

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

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

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

        public java.util.SortedSet getFiles()
        Returns a list of all VersionedFiles, ordered by full name
        Returns:
        a list of all VersionedFiles
      • isEmpty

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

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

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

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

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

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

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

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getAuthors

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

        public java.util.SortedMap getModules()