public class MultiType extends Type
Type.isAssignableFrom(Type), as well as removing non-intersecting
types during a merge.
Note: Currently the | Modifier and Type | Field and Description |
|---|---|
private boolean |
changed |
private java.util.Map |
interfaces |
private MultiType |
mergeSource |
private Type |
potentialClass |
private Type |
resolved |
| Constructor and Description |
|---|
MultiType(java.util.Map interfaces) |
MultiType(java.util.Map interfaces,
Type potentialClass) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
private java.util.Map |
getAllMultiInterfaces(MultiType type) |
Type |
getComponent()
Always returns null since this type is never used for an array.
|
CtClass |
getCtClass()
Gets the class that corresponds with this type.
|
int |
getSize()
Always returns 1, since this type is a reference.
|
private boolean |
inMergeSource(MultiType source) |
boolean |
isArray()
Always reutnrs false since this type is never used for an array
|
boolean |
isAssignableFrom(Type type)
Determines whether this type is assignable, to the passed type.
|
boolean |
isAssignableTo(Type type) |
boolean |
isReference()
Always returns true, since this type is always a reference.
|
Type |
merge(Type type)
Finds the common base type, or interface which both this and the specified
type can be assigned.
|
private java.util.Map |
mergeMultiAndSingle(MultiType multi,
Type single) |
private java.util.Map |
mergeMultiInterfaces(MultiType type1,
MultiType type2) |
(package private) boolean |
popChanged()
Returns true if the internal state has changed.
|
private void |
propogateResolved() |
private void |
propogateState() |
java.lang.String |
toString() |
arrayName, eq, findCommonInterfaces, get, getAllInterfaces, getDeclaredInterfaces, getDimensions, getRootComponent, isSpecialprivate java.util.Map interfaces
private Type resolved
private Type potentialClass
private MultiType mergeSource
private boolean changed
public MultiType(java.util.Map interfaces)
public MultiType(java.util.Map interfaces,
Type potentialClass)
public CtClass getCtClass()
getCtClass in class Typepublic Type getComponent()
getComponent in class Typepublic int getSize()
public boolean isArray()
boolean popChanged()
popChanged in class Typepublic boolean isAssignableFrom(Type type)
TypeisAssignableFrom in class Typetype - the type to test assignability topublic boolean isAssignableTo(Type type)
private void propogateState()
private void propogateResolved()
public boolean isReference()
isReference in class Typeprivate java.util.Map getAllMultiInterfaces(MultiType type)
private boolean inMergeSource(MultiType source)
public Type merge(Type type)
TypeMultiType,
or a MultiArrayType is returned. Multi-types have special rules,
and successive merges and assignment tests on them will alter their internal state,
as well as other multi-types they have been merged with. This method is used by
the data-flow analyzer to merge the type state from multiple branches.