01: /*
02: * Copyright 2003 The Apache Software Foundation
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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;
19:
20: abstract public class FastMember {
21: protected FastClass fc;
22: protected Member member;
23: protected int index;
24:
25: protected FastMember(FastClass fc, Member member, int index) {
26: this .fc = fc;
27: this .member = member;
28: this .index = index;
29: }
30:
31: abstract public Class[] getParameterTypes();
32:
33: abstract public Class[] getExceptionTypes();
34:
35: public int getIndex() {
36: return index;
37: }
38:
39: public String getName() {
40: return member.getName();
41: }
42:
43: public Class getDeclaringClass() {
44: return fc.getJavaClass();
45: }
46:
47: public int getModifiers() {
48: return member.getModifiers();
49: }
50:
51: public String toString() {
52: return member.toString();
53: }
54:
55: public int hashCode() {
56: return member.hashCode();
57: }
58:
59: public boolean equals(Object o) {
60: if (o == null || !(o instanceof FastMember)) {
61: return false;
62: }
63: return member.equals(((FastMember) o).member);
64: }
65: }
|