|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectpolyglot.ext.param.types.Subst_c
public class 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)
|
int |
hashCode()
|
ClassType |
substClassType(ClassType t)
Perform substitutions on a class type. |
ConstructorInstance |
substConstructor(ConstructorInstance ci)
Perform substitutions on a constructor. |
java.util.List |
substConstructorList(java.util.List list)
Perform substititions on a list of ConstructorInstance . |
FieldInstance |
substField(FieldInstance fi)
Perform substitutions 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 substitutions 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. |
protected java.lang.Object |
substSubstValue(java.lang.Object value)
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. |
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 Subst
public java.util.Iterator entries()
entries
in interface Subst
Iterator
of Map.Entry
.public java.util.Map substitutions()
substitutions
in interface Subst
protected Type uncachedSubstType(Type t)
protected java.lang.Object substSubstValue(java.lang.Object value)
public ClassType substClassType(ClassType t)
public Type substType(Type t)
substType
in interface Subst
public PClass substPClass(PClass pclazz)
substPClass
in interface Subst
public FieldInstance substField(FieldInstance fi)
substField
in interface Subst
public MethodInstance substMethod(MethodInstance mi)
substMethod
in interface Subst
public ConstructorInstance substConstructor(ConstructorInstance ci)
substConstructor
in interface Subst
public java.util.List substTypeList(java.util.List list)
Type
.
substTypeList
in interface Subst
public java.util.List substMethodList(java.util.List list)
MethodInstance
.
substMethodList
in interface Subst
public java.util.List substConstructorList(java.util.List list)
ConstructorInstance
.
substConstructorList
in interface Subst
public java.util.List substFieldList(java.util.List list)
FieldInstance
.
substFieldList
in interface Subst
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |