|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
The common interface representing a reference to a type.
AstTypeReference can be used to refer to the following types:
int, void, etc.null literal.
| Field Summary | |
static int |
TID_BAD
Constant representing the bad type. |
static int |
TID_BOOLEAN
Constant representing the boolean type. |
static int |
TID_BYTE
Constant representing the byte type. |
static int |
TID_CHAR
Constant representing the char type. |
static int |
TID_CLASS
Constant representing a class type. |
static int |
TID_DOUBLE
Constant representing the double type. |
static int |
TID_FLOAT
Constant representing the float type. |
static int |
TID_INT
Constant representing the int type. |
static int |
TID_INTERFACE
Constant representing an interface type. |
static int |
TID_LONG
Constant representing the long type. |
static int |
TID_NULL
Constant representing the null type. |
static int |
TID_SHORT
Constant representing the short type. |
static int |
TID_VOID
Constant representing the void type. |
| Method Summary | |
AstType |
getBaseType()
Returns the base type of this type. |
int |
getKind()
Returns the kind of this type encoded as an integer. |
java.lang.String |
getSignature()
Returns the signature of this type. |
java.lang.String |
getTypeName()
Returns the fully qualified name of this type optionally followed by brackets for array types. |
boolean |
isAssignableTo(AstTypeReference type)
Indicates whether an expression of this type can be assigned to a variable of the given type without explicit type conversion. |
boolean |
isDerivedFrom(AstTypeReference type)
Indicates whether this type is a subtype of the specified type. |
int |
numDimensions()
Returns number of dimensions for array types. |
| Field Detail |
public static final int TID_BAD
public static final int TID_BOOLEAN
public static final int TID_BYTE
public static final int TID_CHAR
public static final int TID_CLASS
public static final int TID_DOUBLE
public static final int TID_FLOAT
public static final int TID_INT
public static final int TID_INTERFACE
public static final int TID_LONG
public static final int TID_NULL
public static final int TID_SHORT
public static final int TID_VOID
| Method Detail |
public AstType getBaseType()
null.public int getKind()
public java.lang.String getSignature()
For example, a variable declared as double d[][][]
would return "[[[D".
public java.lang.String getTypeName()
For example, this will return java/lang/String[]
for an array of Strings.
public boolean isAssignableTo(AstTypeReference type)
public boolean isDerivedFrom(AstTypeReference type)
Returns true if the following conditions are met:
type parameter is a class or interface type.type itself, extends or implements
it either directly or indirectly.AstType.isDerivedFrom(com.togethersoft.sca.ast.AstType)public int numDimensions()
int[][] type. Returns 0 for non-array types.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||