Class RepositoryStatistics
java.lang.Object
io.jenkins.plugins.forensics.miner.RepositoryStatistics
- All Implemented Interfaces:
Serializable
Provides access to the SCM commit statistics of all repository files up to a specific commit.
- Author:
- Ullrich Hafner
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty instance ofRepositoryStatistics
with no latest commit ID set.RepositoryStatistics
(String latestCommitId) Creates an empty instance ofRepositoryStatistics
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
add
(FileStatistics additionalStatistics) Adds the additional file statistics instance.void
addAll
(RepositoryStatistics additionalStatistics) Adds all additional file statistics.void
addAll
(Collection<FileStatistics> additionalStatistics) Adds all additional file statistics.void
addAll
(List<CommitDiffItem> commits) Adds and inspects the specified commits.boolean
Returns whether the specified file is part of the repository.boolean
Returns the statistics for the specified file.getFiles()
Returns the absolute file names of the files that are part of the repository.Returns the statistics for all repository files.Returns the ID of the latest commit mined.Returns the mapping of file names to statistics.int
int
int
hashCode()
boolean
Returns whether the latest commit ID has been set.boolean
isEmpty()
Returns whether the repository is empty.protected Object
Called after deserialization to retain backward compatibility.int
size()
Returns the number of files in the repository.protected Object
Called before serialization to fill the fileStatistics field.
-
Constructor Details
-
RepositoryStatistics
public RepositoryStatistics()Creates an empty instance ofRepositoryStatistics
with no latest commit ID set. -
RepositoryStatistics
Creates an empty instance ofRepositoryStatistics
.- Parameters:
latestCommitId
- the ID of the latest commit that
-
-
Method Details
-
readResolve
Called after deserialization to retain backward compatibility.- Returns:
- this
-
writeReplace
Called before serialization to fill the fileStatistics field.- Returns:
- this
-
isEmpty
public boolean isEmpty()Returns whether the repository is empty.- Returns:
true
if the repository is empty,false
otherwise
-
getLatestCommitId
Returns the ID of the latest commit mined.- Returns:
- ID of the latest commit.
-
hasLatestCommitId
public boolean hasLatestCommitId()Returns whether the latest commit ID has been set.- Returns:
true
if the latest commit ID has been set,false
otherwise
-
size
public int size()Returns the number of files in the repository.- Returns:
- number of files in the repository
-
contains
Returns whether the specified file is part of the repository.- Parameters:
fileName
- the name of the file- Returns:
true
if the file file is part of the repository,false
otherwise
-
getFiles
Returns the absolute file names of the files that are part of the repository.- Returns:
- the file names
-
getFileStatistics
Returns the statistics for all repository files.- Returns:
- the statistics
-
getMapping
Returns the mapping of file names to statistics.- Returns:
- the mapping of file names to statistics
-
get
Returns the statistics for the specified file.- Parameters:
fileName
- absolute file name- Returns:
- the statistics for that file
- Throws:
NoSuchElementException
- if the file name is not registered
-
addAll
Adds and inspects the specified commits.- Parameters:
commits
- the additional commits
-
addAll
Adds all additional file statistics.- Parameters:
additionalStatistics
- the additional statistics to add
-
addAll
Adds all additional file statistics.- Parameters:
additionalStatistics
- the additional statistics to add
-
add
Adds the additional file statistics instance.- Parameters:
additionalStatistics
- the additional statistics to add
-
getTotalChurn
public int getTotalChurn() -
getTotalLinesOfCode
public int getTotalLinesOfCode() -
getLatestStatistics
-
equals
-
hashCode
public int hashCode()
-