Top Description Fields Constructors Methods
org.aspectj.apache.bcel.generic

public abstract Class ReferenceType

extends Type
Class Inheritance
Known Direct Subclasses
org.aspectj.apache.bcel.generic.ArrayType, org.aspectj.apache.bcel.generic.ObjectType
Imports
org.aspectj.apache.bcel.Constants, .Repository, org.aspectj.apache.bcel.classfile.JavaClass

Super class for object and array types.
Author
M. Dahm
Version
$Id: ReferenceType.java,v 1.6 2009/09/09 22:18:20 aclement Exp $

Field Summary

Inherited from org.aspectj.apache.bcel.generic.Type:
BOOLEANBYTECHARCLASSCLASS_ARRAYDOUBLEEXCEPTIONFLOATINTINTEGERITERATORLISTLONGNO_ARGSNULLOBJECTOBJECT_ARRAYSHORTsignatureSTRINGSTRING_ARRAYSTRINGARRAY1STRINGARRAY2STRINGARRAY3STRINGARRAY4STRINGARRAY5STRINGARRAY6STRINGARRAY7STRINGBUFFERSTRINGBUILDERTHROWABLEtypeUNKNOWNVOID

Constructor Summary

AccessConstructor and Description
protected
ReferenceType(byte t, String s)

pack-priv

Method Summary

Modifier and TypeMethod and Description
public ReferenceType
getFirstCommonSuperclass(ReferenceType t)

This commutative operation returns the first common superclass (narrowest ReferenceType referencing a class, not an interface).

public boolean
isAssignmentCompatibleWith(Type t)

Return true iff this is assignment compatible with another type t as defined in the JVM specification; see the AASTORE definition there.

public boolean
isCastableTo(Type t)

Return true iff this type is castable to another type t as defined in the JVM specification.

Inherited from org.aspectj.apache.bcel.generic.Type:
getArgumentSizesgetArgumentTypesgetReturnTypegetSignaturegetSignaturegetSignaturegetSizegetTypegetTypegetTypegetTypeInternalgetTypeSizetoString

Constructor Detail

ReferenceTypeback to summary
protected ReferenceType(byte t, String s)
ReferenceTypeback to summary
pack-priv ReferenceType()

Method Detail

getFirstCommonSuperclassback to summary
public ReferenceType getFirstCommonSuperclass(ReferenceType t)

This commutative operation returns the first common superclass (narrowest ReferenceType referencing a class, not an interface). If one of the types is a superclass of the other, the former is returned. If "this" is Type.NULL, then t is returned. If t is Type.NULL, then "this" is returned. If "this" equals t ['this.equals(t)'] "this" is returned. If "this" or t is an ArrayType, then Type.OBJECT is returned; unless their dimensions match. Then an ArrayType of the same number of dimensions is returned, with its basic type being the first common super class of the basic types of "this" and t. If "this" or t is a ReferenceType referencing an interface, then Type.OBJECT is returned. If not all of the two classes' superclasses cannot be found, "null" is returned. See the JVM specification edition 2, "4.9.2 The Bytecode Verifier".

isAssignmentCompatibleWithback to summary
public boolean isAssignmentCompatibleWith(Type t)

Return true iff this is assignment compatible with another type t as defined in the JVM specification; see the AASTORE definition there.

isCastableToback to summary
public boolean isCastableTo(Type t)

Return true iff this type is castable to another type t as defined in the JVM specification. The case where this is Type.NULL is not defined (see the CHECKCAST definition in the JVM specification). However, because e.g. CHECKCAST doesn't throw a ClassCastException when casting a null reference to any Object, true is returned in this case.