01: package net.sourceforge.jaxor.parser;
02:
03: import net.sourceforge.jaxor.util.ObjectUtils;
04:
05: /*
06: * User: Mike
07: * Date: Oct 22, 2002
08: * Time: 10:36:09 AM
09: */
10:
11: public class Import {
12: private String _name;
13:
14: public Import() {
15: }
16:
17: public Import(String name) {
18: _name = name;
19: }
20:
21: public void setName(String name) {
22: _name = name;
23: }
24:
25: public String getName() {
26: return _name;
27: }
28:
29: public int hashCode() {
30: return _name.hashCode();
31: }
32:
33: public boolean equals(Object obj) {
34: if (obj instanceof Import)
35: return equals((Import) obj);
36: return false;
37: }
38:
39: public boolean equals(Import i) {
40: return ObjectUtils.equals(_name, i._name);
41: }
42:
43: public String toString() {
44: return "import " + _name + ";";
45: }
46:
47: public boolean isWildcard() {
48: return _name.endsWith("*");
49: }
50:
51: public String asStringNoWildcard() {
52: return _name.substring(0, _name.indexOf("*") - 1);
53: }
54: }
|