KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > bak > pcj > benchmark > Result


1 /*
2  * Primitive Collections for Java.
3  * Copyright (C) 2003 Søren Bak
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this library; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18  */

19 package bak.pcj.benchmark;
20
21 /**
22  * This class represents results from benchmarks.
23  *
24  * @author Søren Bak
25  * @version 1.0 2003/4/1
26  * @since 1.0
27  */

28 public class Result {
29
30     /** The time registered for this result. */
31     private long time;
32
33     /** The benchmark identifier of this result. */
34     private String JavaDoc benchmarkId;
35
36     /** The task identifier of this result. */
37     private String JavaDoc taskId;
38
39     /** The description of the task of this result. */
40     private String JavaDoc taskDescription;
41
42     /** The data set identifier of this result. */
43     private String JavaDoc dataSetId;
44
45     /** The class identifier of this result. */
46     private String JavaDoc classId;
47
48     /**
49      * Creates a new result.
50      *
51      * @param benchmarkId
52      * an identifier of the benchmark that produced the
53      * result. Typically the class name.
54      *
55      * @param dataSetId
56      * an identifier of the data set against which the
57      * benchmark was run.
58      *
59      * @param classId
60      * an identifier of the class that is benchmarked.
61      * Typically the class name.
62      *
63      * @param taskId
64      * an identifier of the task that was measured. Typically
65      * the name of a method in a benchmark.
66      *
67      * @param taskDescription
68      * a description of the task.
69      *
70      * @param time
71      * the time measured for completing the task.
72      *
73      * @throws NullPointerException
74      * if <tt>benchmarkId</tt> is <tt>null</tt>;
75      * if <tt>dataSetId</tt> is <tt>null</tt>;
76      * if <tt>classId</tt> is <tt>null</tt>;
77      * if <tt>taskId</tt> is <tt>null</tt>;
78      * if <tt>taskDescription</tt> is <tt>null</tt>.
79      *
80      * @throws IllegalArgumentException
81      * if <tt>time</tt> is negative.
82      */

83     public Result(String JavaDoc benchmarkId, String JavaDoc dataSetId, String JavaDoc classId, String JavaDoc taskId, String JavaDoc taskDescription, long time) {
84         if (benchmarkId == null || dataSetId == null || classId == null || taskId == null || taskDescription == null)
85             throw new NullPointerException JavaDoc();
86         if (time < 0L)
87             throw new IllegalArgumentException JavaDoc();
88         this.benchmarkId = benchmarkId;
89         this.taskId = taskId;
90         this.dataSetId = dataSetId;
91         this.classId = classId;
92         this.taskDescription = taskDescription;
93         this.time = time;
94     }
95
96     /**
97      * Returns the benchmark identifier of this result.
98      *
99      * @return the benchmark identifier of this result.
100      */

101     public String JavaDoc getBenchmarkId()
102     { return benchmarkId; }
103     
104     /**
105      * Returns the task identifier of this result.
106      *
107      * @return the task identifier of this result.
108      */

109     public String JavaDoc getTaskId()
110     { return taskId; }
111
112     /**
113      * Returns the description of the task of this result.
114      *
115      * @return the description of the task of this result.
116      */

117     public String JavaDoc getTaskDescription()
118     { return taskDescription; }
119     
120     /**
121      * Returns the data set identifier of this result.
122      *
123      * @return the data set identifier of this result.
124      */

125     public String JavaDoc getDataSetId()
126     { return dataSetId; }
127     
128     /**
129      * Returns the class identifier of this result.
130      *
131      * @return the class identifier of this result.
132      */

133     public String JavaDoc getClassId()
134     { return classId; }
135
136     /**
137      * Returns the time registered for this result.
138      *
139      * @return the time registered for this result.
140      */

141     public long getTime()
142     { return time; }
143
144
145 }
Popular Tags