KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > polyglot > ext > coffer > types > Key_c


1 package polyglot.ext.coffer.types;
2
3 import polyglot.ext.jl.types.*;
4 import polyglot.types.*;
5 import polyglot.visit.*;
6 import polyglot.util.*;
7
8 public abstract class Key_c extends TypeObject_c implements Key
9 {
10     protected String JavaDoc name;
11
12     public Key_c(TypeSystem ts, Position pos, String JavaDoc name) {
13         super(ts, pos);
14         this.name = name;
15     }
16
17     public String JavaDoc name() {
18         return name;
19     }
20
21     public Key name(String JavaDoc name) {
22     Key_c n = (Key_c) copy();
23     n.name = name;
24     return n;
25     }
26
27     public boolean equalsImpl(TypeObject o) {
28         return o == this;
29     }
30
31     public int hashCode() {
32         return name.hashCode();
33     }
34
35     public String JavaDoc toString() {
36         return name;
37         // return getClass().getName() + "(" + name + "@" + System.identityHashCode(this) + ")";
38
}
39
40     public boolean isCanonical() {
41         return true;
42     }
43 }
44
Popular Tags