KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > sf > cglib > reflect > FastMember


1 /*
2  * Copyright 2003 The Apache Software Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of 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,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package net.sf.cglib.reflect;
17
18 import java.lang.reflect.Member JavaDoc;
19
20 abstract public class FastMember
21 {
22     protected FastClass fc;
23     protected Member JavaDoc member;
24     protected int index;
25
26     protected FastMember(FastClass fc, Member JavaDoc member, int index) {
27         this.fc = fc;
28         this.member = member;
29         this.index = index;
30     }
31
32     abstract public Class JavaDoc[] getParameterTypes();
33     abstract public Class JavaDoc[] getExceptionTypes();
34
35     public int getIndex() {
36         return index;
37     }
38
39     public String JavaDoc getName() {
40         return member.getName();
41     }
42
43     public Class JavaDoc getDeclaringClass() {
44         return fc.getJavaClass();
45     }
46
47     public int getModifiers() {
48         return member.getModifiers();
49     }
50
51     public String JavaDoc toString() {
52         return member.toString();
53     }
54
55     public int hashCode() {
56         return member.hashCode();
57     }
58
59     public boolean equals(Object JavaDoc o) {
60         if (o == null || !(o instanceof FastMember)) {
61             return false;
62         }
63         return member.equals(((FastMember)o).member);
64     }
65 }
66
Popular Tags