|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
A Type
is the base type of all classes which represent
types.
Method Summary | |
ArrayType |
arrayOf()
Return an array of this type. |
ArrayType |
arrayOf(int dims)
Return a dims -array of this type. |
boolean |
descendsFrom(Type ancestor)
Return true if this type descends from ancestor . |
boolean |
descendsFromImpl(Type t)
Return true if this type descends from ancestor . |
boolean |
isArray()
Return true if an array type. |
boolean |
isBoolean()
Return true if boolean. |
boolean |
isByte()
Return true if byte. |
boolean |
isCastValid(Type toType)
Return true if this type can be cast to toType . |
boolean |
isCastValidImpl(Type t)
Return true if this type can be cast to toType . |
boolean |
isChar()
Return true if char. |
boolean |
isClass()
Return true if a class type. |
boolean |
isComparable(Type t)
Return true if the types can be compared; that is, if they have the same type system. |
boolean |
isDouble()
Return true if double. |
boolean |
isFloat()
Return true if float. |
boolean |
isImplicitCastValid(Type toType)
Return true if a value of this type can be assigned to a variable of type toType . |
boolean |
isImplicitCastValidImpl(Type t)
Return true if a value of this type can be assigned to a variable of type toType . |
boolean |
isInt()
Return true if int. |
boolean |
isIntOrLess()
Return true if int, short, byte, or char. |
boolean |
isLong()
Return true if long. |
boolean |
isLongOrLess()
Return true if long, int, short, byte, or char. |
boolean |
isNull()
Return true if a null type. |
boolean |
isNumeric()
Return true if double, float, long, int, short, byte, or char. |
boolean |
isPrimitive()
Return true if a primitive type. |
boolean |
isReference()
Return true if a reference type. |
boolean |
isShort()
Return true if short. |
boolean |
isSubtype(Type ancestor)
Return true if this type is a subtype of ancestor . |
boolean |
isSubtypeImpl(Type t)
Return true if this type is a subtype of ancestor . |
boolean |
isThrowable()
Return true if a subclass of Throwable. |
boolean |
isUncheckedException()
Return true if an unchecked exception. |
boolean |
isVoid()
Return true if void. |
boolean |
numericConversionValid(long value)
Return true a literal value can be converted to this type. |
boolean |
numericConversionValid(java.lang.Object value)
Return true a literal value can be converted to this type. |
boolean |
numericConversionValidImpl(long value)
Return true a literal value can be converted to this type. |
boolean |
numericConversionValidImpl(java.lang.Object value)
Return true a literal value can be converted to this type. |
ArrayType |
toArray()
Cast the type to an array type, or null. |
ClassType |
toClass()
Cast the type to a class type, or null. |
NullType |
toNull()
Cast the type to a null type, or null. |
PrimitiveType |
toPrimitive()
Cast the type to a primitive type, or null. |
ReferenceType |
toReference()
Cast the type to a reference type, or null. |
java.lang.String |
toString()
Yields a string representing this type. |
java.lang.String |
translate(Resolver c)
Return a string into which to translate the type. |
Methods inherited from interface polyglot.types.Qualifier |
isPackage, isType, toPackage, toType |
Methods inherited from interface polyglot.types.TypeObject |
equalsImpl, isCanonical, position, typeSystem |
Methods inherited from interface polyglot.util.Copy |
copy |
Method Detail |
public java.lang.String translate(Resolver c)
c
- A resolver in which to lookup this type to determine if
the type is unique in the given resolver.public ArrayType arrayOf()
public ArrayType arrayOf(int dims)
dims
-array of this type.
public ClassType toClass()
public NullType toNull()
public ReferenceType toReference()
public PrimitiveType toPrimitive()
public ArrayType toArray()
public boolean isSubtype(Type ancestor)
ancestor
.
public boolean descendsFrom(Type ancestor)
ancestor
.
public boolean isCastValid(Type toType)
toType
.
public boolean isImplicitCastValid(Type toType)
toType
.
public boolean numericConversionValid(java.lang.Object value)
value
can be converted to this type.
public boolean numericConversionValid(long value)
value
can be converted to this type.
public boolean isSubtypeImpl(Type t)
ancestor
.
public boolean descendsFromImpl(Type t)
ancestor
.
public boolean isCastValidImpl(Type t)
toType
.
public boolean isImplicitCastValidImpl(Type t)
toType
.
public boolean numericConversionValidImpl(java.lang.Object value)
value
can be converted to this type.
public boolean numericConversionValidImpl(long value)
value
can be converted to this type.
This method should be removed. It is kept for backward compatibility.
public boolean isPrimitive()
public boolean isVoid()
public boolean isBoolean()
public boolean isChar()
public boolean isByte()
public boolean isShort()
public boolean isInt()
public boolean isLong()
public boolean isFloat()
public boolean isDouble()
public boolean isIntOrLess()
public boolean isLongOrLess()
public boolean isNumeric()
public boolean isReference()
public boolean isNull()
public boolean isArray()
public boolean isClass()
public boolean isThrowable()
public boolean isUncheckedException()
public boolean isComparable(Type t)
public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |