1 package polyglot.ext.coffer.types; 2 3 import polyglot.types.*; 4 import polyglot.ext.param.types.*; 5 import polyglot.util.*; 6 import java.util.*; 7 8 public class CofferSubstClassType_c extends SubstClassType_c 9 implements CofferSubstType 10 { 11 public CofferSubstClassType_c(CofferTypeSystem ts, Position pos, 12 ClassType base, CofferSubst subst) { 13 super(ts, pos, base, subst); 14 } 15 16 19 public PClass instantiatedFrom() { 20 return ((CofferParsedClassType) base).instantiatedFrom(); 21 } 22 23 public List actuals() { 24 PClass pc = instantiatedFrom(); 25 CofferSubst subst = (CofferSubst) this.subst; 26 27 List actuals = new ArrayList(pc.formals().size()); 28 29 for (Iterator i = pc.formals().iterator(); i.hasNext(); ) { 30 Key key = (Key) i.next(); 31 actuals.add(subst.substKey(key)); 32 } 33 34 return actuals; 35 } 36 37 40 public Key key() { 41 CofferClassType base = (CofferClassType) this.base; 42 CofferSubst subst = (CofferSubst) this.subst; 43 return subst.substKey(base.key()); 44 } 45 46 public String toString() { 47 return "tracked(" + subst + ") " + base; 48 } 49 } 50 | Popular Tags |