1 package polyglot.ext.param.types; 2 3 import java.util.Iterator ; 4 import java.util.List ; 5 6 import polyglot.ext.jl.types.ClassType_c; 7 import polyglot.types.ClassType; 8 import polyglot.types.Flags; 9 import polyglot.types.Package; 10 import polyglot.types.Resolver; 11 import polyglot.types.Type; 12 import polyglot.types.TypeObject; 13 import polyglot.util.Position; 14 15 20 public class SubstClassType_c extends ClassType_c implements SubstType 21 { 22 23 protected ClassType base; 24 25 26 protected Subst subst; 27 28 public SubstClassType_c(ParamTypeSystem ts, Position pos, 29 ClassType base, Subst subst) 30 { 31 super(ts, pos); 32 this.base = base; 33 this.subst = subst; 34 } 35 36 40 public Iterator entries() { 41 return subst.entries(); 42 } 43 44 45 public Type base() { 46 return base; 47 } 48 49 50 public Subst subst() { 51 return subst; 52 } 53 54 57 58 public Type superType() { 59 return subst.substType(base.superType()); 60 } 61 62 63 public List interfaces() { 64 return subst.substTypeList(base.interfaces()); 65 } 66 67 68 public List fields() { 69 return subst.substFieldList(base.fields()); 70 } 71 72 73 public List methods() { 74 return subst.substMethodList(base.methods()); 75 } 76 77 78 public List constructors() { 79 return subst.substConstructorList(base.constructors()); 80 } 81 82 83 public List memberClasses() { 84 return subst.substTypeList(base.memberClasses()); 85 } 86 87 88 public ClassType outer() { 89 return (ClassType) subst.substType(base.outer()); 90 } 91 92 95 96 public ClassType.Kind kind() { 97 return base.kind(); 98 } 99 100 101 public boolean inStaticContext() { 102 return base.inStaticContext(); 103 } 104 105 106 public String fullName() { 107 return base.fullName(); 108 } 109 110 111 public String name() { 112 return base.name(); 113 } 114 115 116 public Package package_() { 117 return base.package_(); 118 } 119 120 public Flags flags() { 121 return base.flags(); 122 } 123 124 public String translate(Resolver c) { 125 return base.translate(c); 126 } 127 128 131 132 public boolean equalsImpl(TypeObject t) { 133 if (t instanceof SubstType) { 134 SubstType x = (SubstType) t; 135 return base.equals(x.base()) && subst.equals(x.subst()); 136 } 137 return false; 138 } 139 140 141 public int hashCode() { 142 return base.hashCode() ^ subst.hashCode(); 143 } 144 145 public String toString() { 146 return base.toString() + subst.toString(); 147 } 148 } 149 | Popular Tags |