1 package polyglot.ext.jl.types; 2 3 import polyglot.types.*; 4 import polyglot.util.*; 5 6 10 public class InitializerInstance_c extends TypeObject_c 11 implements InitializerInstance 12 { 13 protected ClassType container; 14 protected Flags flags; 15 16 17 protected InitializerInstance_c() { } 18 19 public InitializerInstance_c(TypeSystem ts, Position pos, 20 ClassType container, Flags flags) { 21 super(ts, pos); 22 this.container = container; 23 this.flags = flags; 24 } 25 26 public ReferenceType container() { 27 return container; 28 } 29 30 public InitializerInstance container(ClassType container) { 31 if (this.container != container) { 32 InitializerInstance_c n = (InitializerInstance_c) copy(); 33 n.container = container; 34 return n; 35 } 36 return this; 37 } 38 39 public Flags flags() { 40 return flags; 41 } 42 43 public InitializerInstance flags(Flags flags) { 44 if (!flags.equals(this.flags)) { 45 InitializerInstance_c n = (InitializerInstance_c) copy(); 46 n.flags = flags; 47 return n; 48 } 49 return this; 50 } 51 52 public int hashCode() { 53 return container.hashCode() + flags.hashCode(); 54 } 55 56 public boolean equalsImpl(TypeObject o) { 57 if (o instanceof InitializerInstance) { 58 InitializerInstance i = (InitializerInstance) o; 59 return flags.equals(i.flags()) && ts.equals(container, i.container()); 60 } 61 62 return false; 63 } 64 65 public String toString() { 66 return flags.translate() + "initializer"; 67 } 68 69 public boolean isCanonical() { 70 return true; 71 } 72 } 73 | Popular Tags |