net.sf.statcvs.input
Class FileBuilder
Builds a
VersionedFile
with
Revision
s from logging data.
This class is responsible for deciding if a file or revisions will be
included in the report, for translating from CVS logfile data structures
to the data structures in the
net.sf.statcvs.model package, and
for calculating the LOC history for the file.
A main goal of this class is to delay the creation of the
VersionedFile
object until all revisions of the file have been collected from the log.
We could simply create
VersionedFile and
Revisions on the fly
as we parse through the log, but this creates a problem if we decide not
to include the file after reading several revisions. The creation of a
VersionedFile or
Revision can cause many more objects to
be created (
Author,
Directory,
Commit), and
it would be very hard to get rid of them if we don't want the file. This
problem is solved by first collecting all information about one file in
this class, and then, with all information present, deciding if we want
to create the model instances or not.
$Id: FileBuilder.java,v 1.18 2008/04/02 11:22:14 benoitx Exp $- Richard Cyganiak
- Tammo van Lessen
FileBuilder(Builder builder, String name, boolean isBinary, Map revBySymnames) - Creates a new FileBuilder.
|
FileBuilder
public FileBuilder(Builder builder,
String name,
boolean isBinary,
Map revBySymnames)
Creates a new FileBuilder.
builder
- a Builder that provides factory services for
author and directory instances and line counts.name
- the filenameisBinary
- Is this a binary file or not?
addRevisionData
public void addRevisionData(RevisionData data)
Adds a revision to the file. The revisions must be added in the
same order as they appear in the CVS logfile, that is, most recent
first.
createFile
public VersionedFile createFile(Date beginOfLogDate)
Creates and returns a
VersionedFile
representation of the file.
null is returned if the file does not meet certain criteria,
for example if its filename meets an exclude filter or if it was dead
during the entire logging timespan.
beginOfLogDate
- the date of the begin of the log
- a VersionedFile representation of the file.
hasLocalCVSMetadata
public boolean hasLocalCVSMetadata()
hasLocalFileNotFound
public boolean hasLocalFileNotFound()
hasUnexpectedLocalRevision
public boolean hasUnexpectedLocalRevision()