Class ReportManager
- java.lang.Object
-
- uk.ac.warwick.dcs.sherlock.engine.report.ReportManager
-
- All Implemented Interfaces:
IReportManager<SubmissionMatchGroup,SubmissionSummary>
public class ReportManager extends java.lang.Object implements IReportManager<SubmissionMatchGroup,SubmissionSummary>
A class to handle report generation in general (does not generate fileReportMap itself).It takes all possible inputs that may be relevant from postprocessing, and handles requests for fileReportMap; sending the relevant information to the actual report generator in use.
-
-
Constructor Summary
Constructors Constructor Description ReportManager(IResultJob results)
Initialises the report manager with a set of results.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<SubmissionSummary>
GetMatchingSubmissions()
To be called by the web report pages.java.util.List<SubmissionMatchGroup>
GetSubmissionComparison(java.util.List<ISubmission> submissions)
Compares two submissions, finds all the matches in files they contain between them, and returns all relevant information about them.ITuple<java.util.List<SubmissionMatchGroup>,java.lang.String>
GetSubmissionReport(ISubmission submission)
Generate a report for a single submission, containing all matches for all files within it, and a summary of the report as a string.
-
-
-
Constructor Detail
-
ReportManager
public ReportManager(IResultJob results)
Initialises the report manager with a set of results.- Parameters:
results
- Contains a full set of results from postprocessing; all useful info is extracted from here
-
-
Method Detail
-
GetMatchingSubmissions
public java.util.List<SubmissionSummary> GetMatchingSubmissions()
To be called by the web report pages. Gets a list of submission summaries.- Specified by:
GetMatchingSubmissions
in interfaceIReportManager<SubmissionMatchGroup,SubmissionSummary>
- Returns:
- a list of the matching SubmissionSummaries, each containing their ids, overall scores, and a list of the submissions that they were matched with.
-
GetSubmissionComparison
public java.util.List<SubmissionMatchGroup> GetSubmissionComparison(java.util.List<ISubmission> submissions)
Compares two submissions, finds all the matches in files they contain between them, and returns all relevant information about them.- Specified by:
GetSubmissionComparison
in interfaceIReportManager<SubmissionMatchGroup,SubmissionSummary>
- Parameters:
submissions
- The submissions to compare (should be a list of two submissions only; any submissions beyond the first two are ignored)- Returns:
- A list of SubmissionMatchGroup objects which contain lists of SubmissionMatch objects; each have ids of the two matching files, a score for the match, a reason from the DetectionType, and the line numbers in each file where the match occurs.
-
GetSubmissionReport
public ITuple<java.util.List<SubmissionMatchGroup>,java.lang.String> GetSubmissionReport(ISubmission submission)
Generate a report for a single submission, containing all matches for all files within it, and a summary of the report as a string.- Specified by:
GetSubmissionReport
in interfaceIReportManager<SubmissionMatchGroup,SubmissionSummary>
- Parameters:
submission
- The submission to generate the report for.- Returns:
- A tuple. The key contains a list of SubmissionMatchGroup objects which contain lists of SubmissionMatch objects; each have objects which contain ids of the two matching files, a score for the match, a reason from the DetectionType, and the line numbers in each file where the match occurs. The value is the report summary.
-
-