public class JTypeOracle extends Object implements Serializable
Constructor and Description |
---|
JTypeOracle(JProgram program) |
Modifier and Type | Method and Description |
---|---|
boolean |
canBeJavaScriptObject(JType type)
True if the type is a JSO or interface implemented by JSO..
|
boolean |
canTheoreticallyCast(JReferenceType type,
JReferenceType qType) |
boolean |
canTriviallyCast(JReferenceType type,
JReferenceType qType) |
boolean |
canTriviallyCast(JType type,
JType qType) |
void |
computeBeforeAST() |
Set<JMethod> |
getAllOverrides(JMethod method)
References to any methods which this method implementation might override
or implement in any instantiable class, including strange cases where there
is no direct relationship between the methods except in a subclass that
inherits one and implements the other.
|
Set<JReferenceType> |
getInstantiatedTypes() |
JMethod |
getPolyMethod(JClassType type,
String signature) |
JClassType |
getSingleJsoImpl(JReferenceType maybeSingleJsoIntf) |
boolean |
isDualJsoInterface(JReferenceType maybeDualImpl) |
boolean |
isEffectivelyJavaScriptObject(JType type)
True if either a JSO, or is an interface that is ONLY implemented by a JSO.
|
boolean |
isInstantiatedType(JDeclaredType type)
Determine whether a type is instantiated.
|
boolean |
isInstantiatedType(JReferenceType type)
Determine whether a type is instantiated.
|
boolean |
isSameOrSuper(JClassType type,
JClassType qType) |
boolean |
isSingleJsoImpl(JType type) |
boolean |
isSubClass(JClassType type,
JClassType qType)
Returns true if qType is a subclass of type, directly or indirectly.
|
boolean |
isSuperClass(JClassType type,
JClassType qType)
Returns true if qType is a superclass of type, directly or indirectly.
|
static boolean |
methodsDoMatch(JMethod method1,
JMethod method2)
Compare two methods based on name and original argument types
JMethod.getOriginalParamTypes() . |
void |
recomputeAfterOptimizations()
This method should be called after altering the types that are live in the
associated JProgram.
|
void |
setInstantiatedTypes(Set<JReferenceType> instantiatedTypes) |
public JTypeOracle(JProgram program)
public static boolean methodsDoMatch(JMethod method1, JMethod method2)
JMethod.getOriginalParamTypes()
. Note that nothing special is done
here regarding methods with type parameters in their argument lists. The
caller must be careful that this level of matching is sufficient.public boolean canBeJavaScriptObject(JType type)
type
- public boolean canTheoreticallyCast(JReferenceType type, JReferenceType qType)
public boolean canTriviallyCast(JReferenceType type, JReferenceType qType)
public void computeBeforeAST()
public Set<JMethod> getAllOverrides(JMethod method)
interface IFoo { foo(); } class Unrelated { foo() { ... } } class Foo extends Unrelated implements IFoo { }In this case,
Unrelated.foo()
virtually implements
IFoo.foo()
in subclass Foo
.public Set<JReferenceType> getInstantiatedTypes()
public JMethod getPolyMethod(JClassType type, String signature)
public JClassType getSingleJsoImpl(JReferenceType maybeSingleJsoIntf)
public boolean isDualJsoInterface(JReferenceType maybeDualImpl)
public boolean isEffectivelyJavaScriptObject(JType type)
public boolean isInstantiatedType(JDeclaredType type)
public boolean isInstantiatedType(JReferenceType type)
public boolean isSameOrSuper(JClassType type, JClassType qType)
public boolean isSingleJsoImpl(JType type)
public boolean isSubClass(JClassType type, JClassType qType)
public boolean isSuperClass(JClassType type, JClassType qType)
public void recomputeAfterOptimizations()
public void setInstantiatedTypes(Set<JReferenceType> instantiatedTypes)
Copyright © 2018. All rights reserved.