|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectpolyglot.ext.param.types.Subst_c
Utility class that performs substitutions on type objects using a map. Subclasses must define how the substititions are performed and how to cache substituted types.
| Nested Class Summary | |
class |
Subst_c.ConstructorXform
Function object for transforming constructors. |
class |
Subst_c.FieldXform
Function object for transforming fields. |
class |
Subst_c.MethodXform
Function object for transforming methods. |
class |
Subst_c.TypeXform
Function object for transforming types. |
| Field Summary | |
protected java.util.Map |
cache
Cache of types. |
protected java.util.Map |
subst
Map from formal parameters (of type Param) to actuals. |
protected ParamTypeSystem |
ts
|
| Constructor Summary | |
Subst_c(ParamTypeSystem ts,
java.util.Map subst,
java.util.Map cache)
|
|
| Method Summary | |
java.util.Iterator |
entries()
Entries of the underlying substitution map. |
boolean |
equals(java.lang.Object o)
|
protected java.lang.Object |
getSubstValueAsKey(java.lang.Object v)
When adding a new substitution A->B to the map, we need to check if there are already any existing substitutions, say C->A, and if so, replace them appropriately, in this case with C->B. |
int |
hashCode()
|
ClassType |
substClassType(ClassType t)
Perform substitutions on a class type. |
ConstructorInstance |
substConstructor(ConstructorInstance ci)
Perform substititions on a constructor. |
java.util.List |
substConstructorList(java.util.List list)
Perform substititions on a list of ConstructorInstance. |
FieldInstance |
substField(FieldInstance fi)
Perform substititions on a field. |
java.util.List |
substFieldList(java.util.List list)
Perform substititions on a list of FieldInstance. |
java.util.Map |
substitutions()
The underlying substitution map. |
MethodInstance |
substMethod(MethodInstance mi)
Perform substititions on a method. |
java.util.List |
substMethodList(java.util.List list)
Perform substititions on a list of MethodInstance. |
PClass |
substPClass(PClass pclazz)
Perform substitution on a PClass. |
Type |
substType(Type t)
Perform substitutions on a type. |
java.util.List |
substTypeList(java.util.List list)
Perform substititions on a list of Type. |
java.lang.String |
toString()
|
ParamTypeSystem |
typeSystem()
Type system |
protected Type |
uncachedSubstType(Type t)
Perform substitutions on a type, without checking the cache. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.util.Map subst
protected transient java.util.Map cache
protected transient ParamTypeSystem ts
| Constructor Detail |
public Subst_c(ParamTypeSystem ts,
java.util.Map subst,
java.util.Map cache)
| Method Detail |
public ParamTypeSystem typeSystem()
Subst
typeSystem in interface Substpublic java.util.Iterator entries()
entries in interface SubstIterator of Map.Entry.public java.util.Map substitutions()
substitutions in interface Substprotected Type uncachedSubstType(Type t)
protected java.lang.Object getSubstValueAsKey(java.lang.Object v)
public ClassType substClassType(ClassType t)
public Type substType(Type t)
substType in interface Substpublic PClass substPClass(PClass pclazz)
substPClass in interface Substpublic FieldInstance substField(FieldInstance fi)
substField in interface Substpublic MethodInstance substMethod(MethodInstance mi)
substMethod in interface Substpublic ConstructorInstance substConstructor(ConstructorInstance ci)
substConstructor in interface Substpublic java.util.List substTypeList(java.util.List list)
Type.
substTypeList in interface Substpublic java.util.List substMethodList(java.util.List list)
MethodInstance.
substMethodList in interface Substpublic java.util.List substConstructorList(java.util.List list)
ConstructorInstance.
substConstructorList in interface Substpublic java.util.List substFieldList(java.util.List list)
FieldInstance.
substFieldList in interface Substpublic boolean equals(java.lang.Object o)
public int hashCode()
public java.lang.String toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||