KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > google > gwt > junit > benchmarks > MetaData


1 /*
2  * Copyright 2007 Google Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not
5  * use this file except in compliance with the License. You may obtain a copy of
6  * the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13  * License for the specific language governing permissions and limitations under
14  * the License.
15  */

16 package com.google.gwt.junit.benchmarks;
17
18 /**
19  * The benchmark metadata for a single benchmark method.
20  */

21 class MetaData {
22
23   private CategoryImpl category;
24
25   private String JavaDoc className;
26
27   private String JavaDoc methodName;
28
29   private String JavaDoc sourceCode;
30
31   private String JavaDoc testDescription;
32
33   private String JavaDoc testName;
34
35   public MetaData(String JavaDoc className, String JavaDoc methodName, String JavaDoc sourceCode,
36       CategoryImpl category, String JavaDoc testName, String JavaDoc testDescription) {
37     this.className = className;
38     this.methodName = methodName;
39     this.sourceCode = sourceCode;
40     this.category = category;
41     this.testName = testName;
42     this.testDescription = testDescription;
43   }
44
45   public boolean equals(Object JavaDoc obj) {
46     if (! (obj instanceof MetaData)) {
47       return false;
48     }
49
50     MetaData md = (MetaData) obj;
51
52     return md.className.equals(className) && md.methodName.equals(methodName);
53   }
54
55   public CategoryImpl getCategory() {
56     return category;
57   }
58
59   public String JavaDoc getClassName() {
60     return className;
61   }
62
63   public String JavaDoc getMethodName() {
64     return methodName;
65   }
66
67   public String JavaDoc getSourceCode() {
68     return sourceCode;
69   }
70
71   public String JavaDoc getTestDescription() {
72     return testDescription;
73   }
74
75   public String JavaDoc getTestName() {
76     return testName;
77   }
78
79   public int hashCode() {
80     int result;
81     result = (className != null ? className.hashCode() : 0);
82     result = 29 * result + (methodName != null ? methodName.hashCode() : 0);
83     return result;
84   }
85 }
86
87
Popular Tags