01 /*
02 * BenchmarkReportable.java
03 *
04 * Copyright (c) 2008-2009, Intelius, Inc.
05 *
06 * This file is part of GATE (see http://gate.ac.uk/), and is free
07 * software, licenced under the GNU Library General Public License,
08 * Version 2, June 1991 (in the distribution as file licence.html,
09 * and also available at http://gate.ac.uk/gate/licence.html).
10 *
11 * Chirag Viradiya & Andrew Borthwick, 30/Sep/2009
12 *
13 * $Id$
14 */
15 package gate.util.reporting;
16
17 import java.io.File;
18
19 import gate.util.reporting.exceptions.*;
20
21 /**
22 * An interface to be implemented by all classes responsible for generating
23 * benchmark reports.
24 */
25 public interface BenchmarkReportable {
26 /**
27 * Organizes the log entries in report specific data structure.
28 *
29 * @param inputFile
30 * An input benchmark file handle.
31 * @return An object containing the log entries organized in a report specific
32 * data structure.
33 * @throws BenchmarkReportException
34 * if an error occurs while organizing the log entries.
35 */
36 public Object store(File inputFile) throws BenchmarkReportException;
37
38 /**
39 * Does the report specific calculations.
40 *
41 * @param reportContainer
42 * An object containing the log entries organized in a report
43 * specific data structure.
44 * @return An object containing the log entries organized in a report specific
45 * data structure with report totals calculated.
46 * @throws BenchmarkReportException
47 * if computation error occurs.
48 */
49 public Object calculate(Object reportContainer)
50 throws BenchmarkReportException;
51
52 /**
53 * Prints a report in text or HTML format.
54 *
55 * @param reportContainer
56 * An object containing the log entries organized in a report
57 * specific data structure.
58 * @param outputFile
59 * An output report file handle.
60 * @throws BenchmarkReportException
61 * if report couldn't be printed to given media (text/HTML).
62 */
63 public void printReport(Object reportContainer, File outputFile)
64 throws BenchmarkReportException;
65
66 /**
67 * Parses the command line arguments.
68 *
69 * @param args
70 * A string array containing command line parameters.
71 * @throws BenchmarkReportException
72 * if an invalid argument is provided.
73 */
74 public void parseArguments(String[] args) throws BenchmarkReportException;
75
76 /**
77 * A single method to execute report (A command line counter part API ). Call
78 * this method after setting the report parameters.
79 *
80 * @throws BenchmarkReportException
81 * if an error occurs while generating the report.
82 * @throws BenchmarkReportExecutionException
83 * if the given input file is modified while generating the report.
84 */
85 public void executeReport() throws BenchmarkReportException,
86 BenchmarkReportExecutionException;
87 }
|