01: /*
02: * @(#)MemberNameTriple.java 1.3 06/10/10
03: *
04: * Copyright 1990-2006 Sun Microsystems, Inc. All Rights Reserved.
05: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
06: *
07: * This program is free software; you can redistribute it and/or
08: * modify it under the terms of the GNU General Public License version
09: * 2 only, as published by the Free Software Foundation.
10: *
11: * This program is distributed in the hope that it will be useful, but
12: * WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14: * General Public License version 2 for more details (a copy is
15: * included at /legal/license.txt).
16: *
17: * You should have received a copy of the GNU General Public License
18: * version 2 along with this work; if not, write to the Free Software
19: * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20: * 02110-1301 USA
21: *
22: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
23: * Clara, CA 95054 or visit www.sun.com if you need additional
24: * information or have any questions.
25: *
26: */
27:
28: package components;
29:
30: /*
31: * Encapsulate identifying information for this ClassMember,
32: * in order to easily be able to match methods and fields that
33: * we want to exclude from ROMization.
34: */
35: public class MemberNameTriple {
36: public String clazz; // Classname
37: public String name; // method or field name
38: public String type; // always null if a field
39:
40: public MemberNameTriple(String cls, String nm, String typ) {
41: clazz = cls;
42: name = nm;
43: type = typ;
44: }
45:
46: public boolean sameMember(String classname, String membername,
47: String typestring) {
48: if (!clazz.equals(classname))
49: return false;
50: if (!name.equals(membername))
51: return false;
52: // check for type and typestring null
53: // as for fields.
54: if (type == typestring)
55: return true;
56: // else we're not comparing fields.
57: return type.equals(typestring);
58: }
59:
60: public String toString() {
61: StringBuffer result = new StringBuffer(clazz);
62: result.append('.');
63: result.append(name);
64: if (type != null) {
65: result.append(type);
66: }
67: return result.toString();
68: }
69: }
|