KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > gnu > trove > benchmark > Result


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

19 package gnu.trove.benchmark;
20
21 /**
22  *
23  * Created: Thu Nov 22 20:47:16 2001
24  *
25  * @author Eric D. Friedman
26  * @version $Id: Result.java,v 1.2 2006/11/10 23:27:59 robeden Exp $
27  */

28 class Result {
29     long theirs;
30     long ours;
31     int iterations;
32     String JavaDoc description;
33         
34     /**
35      * Gets the value of theirs
36      *
37      * @return the value of theirs
38      */

39     public long getTheirs() {
40         return this.theirs;
41     }
42
43     /**
44      * Sets the value of theirs
45      *
46      * @param argTheirs Value to assign to this.theirs
47      */

48     public void setTheirs(long argTheirs){
49         this.theirs = argTheirs;
50     }
51
52     /**
53      * Gets the value of ours
54      *
55      * @return the value of ours
56      */

57     public long getOurs() {
58         return this.ours;
59     }
60
61     /**
62      * Sets the value of ours
63      *
64      * @param argOurs Value to assign to this.ours
65      */

66     public void setOurs(long argOurs){
67         this.ours = argOurs;
68     }
69
70     /**
71      * Gets the value of theirAvg
72      *
73      * @return the value of theirAvg
74      */

75     public long getTheirAvg() {
76         return theirs / iterations;
77     }
78
79     /**
80      * Gets the value of ourAvg
81      *
82      * @return the value of ourAvg
83      */

84     public long getOurAvg() {
85         return ours / iterations;
86     }
87
88     /**
89      * Gets the value of iterations
90      *
91      * @return the value of iterations
92      */

93     public int getIterations() {
94         return this.iterations;
95     }
96
97     /**
98      * Sets the value of iterations
99      *
100      * @param argIterations Value to assign to this.iterations
101      */

102     public void setIterations(int argIterations){
103         this.iterations = argIterations;
104     }
105
106     /**
107      * Gets the value of description
108      *
109      * @return the value of description
110      */

111     public String JavaDoc getDescription() {
112         return this.description;
113     }
114
115     /**
116      * Sets the value of description
117      *
118      * @param argDescription Value to assign to this.description
119      */

120     public void setDescription(String JavaDoc argDescription){
121         this.description = argDescription;
122     }
123
124     public String JavaDoc toString() {
125         StringBuffer JavaDoc b = new StringBuffer JavaDoc();
126         b.append(getDescription() + "\n");
127         b.append("Iterations: " + getIterations() + "\n");
128         b.append("Their total (msec): " + getTheirs() + "\n");
129         b.append("Our total (msec): " + getOurs() + "\n");
130         b.append("Their average (msec): " + getTheirAvg() + "\n");
131         b.append("Our average (msec): " + getOurAvg() + "\n");
132         return b.toString();
133     }
134 }
135
Popular Tags