public class Subst_c<Formal extends Param,Actual extends TypeObject> extends java.lang.Object implements Subst<Formal,Actual>
Modifier and Type | Class and Description |
---|---|
protected class |
Subst_c.CacheTypeWrapper |
class |
Subst_c.ConstructorXform<T extends ConstructorInstance>
Function object for transforming constructors.
|
class |
Subst_c.FieldXform<T extends FieldInstance>
Function object for transforming fields.
|
class |
Subst_c.MethodXform<T extends MethodInstance>
Function object for transforming methods.
|
class |
Subst_c.TypeXform<T extends Type>
Function object for transforming types.
|
Modifier and Type | Field and Description |
---|---|
protected java.util.Map<Subst_c.CacheTypeWrapper,Type> |
cache
Cache of types, from CacheTypeWrapper(t) to subst(t).
|
protected java.util.Map<Formal,Actual> |
subst
Map from formal parameters (of type Param) to actuals.
|
protected java.util.Map<ClassType,ClassType> |
substClassTypeCache |
protected ParamTypeSystem<Formal,Actual> |
ts |
Constructor and Description |
---|
Subst_c(ParamTypeSystem<Formal,Actual> ts,
java.util.Map<Formal,? extends Actual> subst) |
Modifier and Type | Method and Description |
---|---|
protected Type |
cacheGet(Type t) |
protected void |
cachePut(Type t,
Type cached) |
protected boolean |
cacheTypeEquality(Type t1,
Type t2)
This method is used by the cache lookup to test type equality.
|
java.util.Iterator<java.util.Map.Entry<Formal,Actual>> |
entries()
Entries of the underlying substitution map.
|
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
java.lang.Iterable<java.util.Map.Entry<Formal,Actual>> |
is_entry()
An Iterable that calls entries().
|
ClassType |
substClassType(ClassType t)
Perform substitutions on a class type.
|
protected ClassType |
substClassTypeImpl(ClassType t) |
<T extends ConstructorInstance> |
substConstructor(T ci)
Perform substitutions on a constructor.
|
<T extends ConstructorInstance> |
substConstructorList(java.util.List<T> list)
Perform substitutions on a list of
ConstructorInstance s. |
protected ReferenceType |
substContainer(MemberInstance mi) |
<T extends FieldInstance> |
substField(T fi)
Perform substitutions on a field.
|
<T extends FieldInstance> |
substFieldList(java.util.List<T> list)
Perform substitutions on a list of
FieldInstance s. |
java.util.Map<Formal,Actual> |
substitutions()
The map of formals to actuals.
|
<T extends MethodInstance> |
substMethod(T mi)
Perform substitutions on a method.
|
<T extends MethodInstance> |
substMethodList(java.util.List<T> list)
Perform substitutions on a list of
MethodInstance s. |
PClass<Formal,Actual> |
substPClass(PClass<Formal,Actual> pclazz)
Perform substitutions on a PClass.
|
protected Actual |
substSubstValue(Actual 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.
|
<T extends Type> |
substTypeList(java.util.List<? extends Type> list)
Perform substitutions on a list of
Type s. |
java.lang.String |
toString() |
ParamTypeSystem<Formal,Actual> |
typeSystem()
Type system
|
protected Subst_c.CacheTypeWrapper |
typeWrapper(Type t) |
protected Type |
uncachedSubstType(Type t)
Perform substitutions on a type, without checking the cache.
|
protected java.util.Map<Formal extends Param,Actual extends TypeObject> subst
protected transient java.util.Map<Subst_c.CacheTypeWrapper,Type> cache
protected transient ParamTypeSystem<Formal extends Param,Actual extends TypeObject> ts
public Subst_c(ParamTypeSystem<Formal,Actual> ts, java.util.Map<Formal,? extends Actual> subst)
public ParamTypeSystem<Formal,Actual> typeSystem()
Subst
typeSystem
in interface Subst<Formal extends Param,Actual extends TypeObject>
public java.util.Iterator<java.util.Map.Entry<Formal,Actual>> entries()
Subst
public java.lang.Iterable<java.util.Map.Entry<Formal,Actual>> is_entry()
Subst
public java.util.Map<Formal,Actual> substitutions()
Subst
substitutions
in interface Subst<Formal extends Param,Actual extends TypeObject>
protected Type uncachedSubstType(Type t)
protected Actual substSubstValue(Actual value)
public final ClassType substClassType(ClassType t)
public Type substType(Type t)
Subst
protected Subst_c.CacheTypeWrapper typeWrapper(Type t)
protected boolean cacheTypeEquality(Type t1, Type t2)
public PClass<Formal,Actual> substPClass(PClass<Formal,Actual> pclazz)
Subst
substPClass
in interface Subst<Formal extends Param,Actual extends TypeObject>
public <T extends FieldInstance> T substField(T fi)
Subst
substField
in interface Subst<Formal extends Param,Actual extends TypeObject>
public <T extends MethodInstance> T substMethod(T mi)
Subst
substMethod
in interface Subst<Formal extends Param,Actual extends TypeObject>
public <T extends ConstructorInstance> T substConstructor(T ci)
Subst
substConstructor
in interface Subst<Formal extends Param,Actual extends TypeObject>
protected ReferenceType substContainer(MemberInstance mi)
public <T extends Type> java.util.List<T> substTypeList(java.util.List<? extends Type> list)
Subst
Type
s.substTypeList
in interface Subst<Formal extends Param,Actual extends TypeObject>
public <T extends MethodInstance> java.util.List<T> substMethodList(java.util.List<T> list)
Subst
MethodInstance
s.substMethodList
in interface Subst<Formal extends Param,Actual extends TypeObject>
public <T extends ConstructorInstance> java.util.List<T> substConstructorList(java.util.List<T> list)
Subst
ConstructorInstance
s.substConstructorList
in interface Subst<Formal extends Param,Actual extends TypeObject>
public <T extends FieldInstance> java.util.List<T> substFieldList(java.util.List<T> list)
Subst
FieldInstance
s.substFieldList
in interface Subst<Formal extends Param,Actual extends TypeObject>
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