|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Type
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 |
---|
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.ArrayType arrayOf()
ArrayType arrayOf(int dims)
dims
-array of this type.
ClassType toClass()
NullType toNull()
ReferenceType toReference()
PrimitiveType toPrimitive()
ArrayType toArray()
boolean isSubtype(Type ancestor)
ancestor
.
boolean descendsFrom(Type ancestor)
ancestor
.
boolean isCastValid(Type toType)
toType
.
boolean isImplicitCastValid(Type toType)
toType
.
boolean numericConversionValid(java.lang.Object value)
value
can be converted to this type.
boolean numericConversionValid(long value)
value
can be converted to this type.
boolean isSubtypeImpl(Type t)
ancestor
.
boolean descendsFromImpl(Type t)
ancestor
.
boolean isCastValidImpl(Type t)
toType
.
boolean isImplicitCastValidImpl(Type t)
toType
.
boolean numericConversionValidImpl(java.lang.Object value)
value
can be converted to this type.
boolean numericConversionValidImpl(long value)
value
can be converted to this type.
This method should be removed. It is kept for backward compatibility.
boolean isPrimitive()
boolean isVoid()
boolean isBoolean()
boolean isChar()
boolean isByte()
boolean isShort()
boolean isInt()
boolean isLong()
boolean isFloat()
boolean isDouble()
boolean isIntOrLess()
boolean isLongOrLess()
boolean isNumeric()
boolean isReference()
boolean isNull()
boolean isArray()
boolean isClass()
boolean isThrowable()
boolean isUncheckedException()
boolean isComparable(Type t)
java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |