Type
instances are merged, if they share more than one super type (either an
interface or a superclass), then a MultiType is used to
represent the possible super types. The goal of a MultiType
is to reduce the set of possible types down to a single resolved type. This
is done by eliminating non-assignable types from the typeset when the
MultiType is passed as an argument to
Type#isAssignableFrom(Type), as well as removing non-intersecting
types during a merge.
Note
Currently the MultiType instance is reused as much
as possible so that updates are visible from all frames. In addition, all
MultiType merge paths are also updated. This is somewhat
hackish, but it appears to handle most scenarios.
| Modifier and Type | Field and Description |
|---|---|
| private boolean | |
| private Map | |
| private MultiType | |
| private Type | |
| private Type |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object
the reference object with which to compare. o)Overrides javassist. Indicates whether some other object is "equal to" this one. |
| private Map | |
| public Type | getComponent()
Overrides javassist. Always returns null since this type is never used for an array. |
| public CtClass | getCtClass()
Overrides javassist. Gets the class that corresponds with this type. |
| public int | getSize()
Overrides javassist. Always returns 1, since this type is a reference. |
| public int | hashCode()
Overrides javassist. Returns a hash code value for this object. |
| private boolean | |
| public boolean | isArray()
Overrides javassist. Always reutnrs false since this type is never used for an array |
| public boolean | isAssignableFrom(Type
the type to test assignability to type)Overrides javassist. Determines whether this type is assignable, to the passed type. |
| public boolean | |
| public boolean | Returns: trueOverrides javassist. Always returns true, since this type is always a reference. |
| public Type | merge(Type
the type to merge with type)Overrides javassist. Finds the common base type, or interface which both this and the specified type can be assigned. |
| private Map | |
| private Map | |
| pack-priv boolean | popChanged()
Overrides javassist. Returns true if the internal state has changed. |
| private void | |
| private void | |
| public String | toString()
Overrides javassist. Returns a string representation of the object. |
| changed | back to summary |
|---|---|
| private boolean changed | |
| interfaces | back to summary |
|---|---|
| private Map<String, CtClass> interfaces | |
| mergeSource | back to summary |
|---|---|
| private MultiType mergeSource | |
| potentialClass | back to summary |
|---|---|
| private Type potentialClass | |
| resolved | back to summary |
|---|---|
| private Type resolved | |
| MultiType | back to summary |
|---|---|
| public MultiType(Map<String, CtClass> interfaces) | |
| MultiType | back to summary |
|---|---|
| public MultiType(Map<String, CtClass> interfaces, Type potentialClass) | |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides javassist. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes. | |
| getAllMultiInterfaces | back to summary |
|---|---|
| private Map | |
| getComponent | back to summary |
|---|---|
| public Type getComponent() Overrides javassist. Always returns null since this type is never used for an array.
| |
| getCtClass | back to summary |
|---|---|
| public CtClass getCtClass() Overrides javassist. Gets the class that corresponds with this type. If this information is not yet known, java.lang.Object will be returned.
| |
| getSize | back to summary |
|---|---|
| public int getSize() Overrides javassist. Always returns 1, since this type is a reference.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides javassist. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| inMergeSource | back to summary |
|---|---|
| private boolean inMergeSource(MultiType source) | |
| isArray | back to summary |
|---|---|
| public boolean isArray() Overrides javassist. Always reutnrs false since this type is never used for an array
| |
| isAssignableFrom | back to summary |
|---|---|
| public boolean isAssignableFrom(Type type) Overrides javassist. Doc from javassist. Determines whether this type is assignable, to the passed type. A type is assignable to another if it is either the same type, or a sub-type. | |
| isAssignableTo | back to summary |
|---|---|
| public boolean isAssignableTo(Type type) | |
| isReference | back to summary |
|---|---|
| public boolean isReference() Overrides javassist. Always returns true, since this type is always a reference.
| |
| merge | back to summary |
|---|---|
| public Type merge(Type type) Overrides javassist. Doc from javassist. Finds the common base type, or interface which both this and the specified
type can be assigned. If there is more than one possible answer, then a | |
| mergeMultiAndSingle | back to summary |
|---|---|
| private Map | |
| mergeMultiInterfaces | back to summary |
|---|---|
| private Map | |
| popChanged | back to summary |
|---|---|
| pack-priv boolean popChanged() Overrides javassist. Returns true if the internal state has changed.
| |
| propogateResolved | back to summary |
|---|---|
| private void propogateResolved() | |
| propogateState | back to summary |
|---|---|
| private void propogateState() | |
| toString | back to summary |
|---|---|
| public String toString() Overrides javassist. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |