01: /**
02: * BSD-style license; for more info see http://pmd.sourceforge.net/license.html
03: */package net.sourceforge.pmd.rules;
04:
05: import net.sourceforge.pmd.ast.SimpleNode;
06:
07: public class ImportWrapper {
08: private SimpleNode node;
09: private String name;
10: private String fullname;
11:
12: public ImportWrapper(String fullname, String name, SimpleNode node) {
13: this .fullname = fullname;
14: this .name = name;
15: this .node = node;
16: }
17:
18: public boolean equals(Object other) {
19: ImportWrapper i = (ImportWrapper) other;
20: if (name == null && i.getName() == null) {
21: return i.getFullName().equals(fullname);
22: }
23: return i.getName().equals(name);
24: }
25:
26: public int hashCode() {
27: if (name == null) {
28: return fullname.hashCode();
29: }
30: return name.hashCode();
31: }
32:
33: public String getName() {
34: return name;
35: }
36:
37: public String getFullName() {
38: return fullname;
39: }
40:
41: public SimpleNode getNode() {
42: return node;
43: }
44: }
|