|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectpolyglot.ext.jl.types.TypeObject_c
polyglot.ext.jl.types.Type_c
public abstract class Type_c
Abstract implementation of a Type. This implements most of
the "isa" and "cast" methods of the type and methods which just dispatch to
the type system.
| Field Summary |
|---|
| Fields inherited from class polyglot.ext.jl.types.TypeObject_c |
|---|
position, ts |
| Constructor Summary | |
|---|---|
protected |
Type_c()
Used for deserializing types. |
|
Type_c(TypeSystem ts)
Creates a new type in the given a TypeSystem. |
|
Type_c(TypeSystem ts,
Position pos)
Creates a new type in the given a TypeSystem at a given position. |
| Method Summary | |
|---|---|
ArrayType |
arrayOf()
Return an array of this type. |
ArrayType |
arrayOf(int dims)
Return a dims-array of this type. |
boolean |
descendsFrom(Type t)
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 |
isCanonical()
Return true if the type object contains no unknown/ambiguous types. |
boolean |
isCastValid(Type toType)
Return true if this type can be cast to toType. |
boolean |
isCastValidImpl(Type toType)
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 toType)
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 |
isPackage()
Return true if the qualifier is a package. |
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 t)
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 |
isType()
Return true if the qualifier is a type. |
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()
Returns a non-null iff isArray() returns true. |
ClassType |
toClass()
Returns a non-null iff isClass() returns true. |
NullType |
toNull()
Returns a non-null iff isNull() returns true. |
Package |
toPackage()
Cast the qualifier to a package, or return null. |
PrimitiveType |
toPrimitive()
Returns a non-null iff isPrimitive() returns true. |
ReferenceType |
toReference()
Returns a non-null iff isReference() returns true. |
abstract java.lang.String |
toString()
Yields a string representing this type. |
Type |
toType()
Cast the qualifier to a type, or return null. |
abstract java.lang.String |
translate(Resolver c)
Return a string into which to translate the type. |
| Methods inherited from class polyglot.ext.jl.types.TypeObject_c |
|---|
copy, equals, equalsImpl, hashCode, position, typeSystem |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface polyglot.types.TypeObject |
|---|
equalsImpl, position, typeSystem |
| Methods inherited from interface polyglot.util.Copy |
|---|
copy |
| Constructor Detail |
|---|
protected Type_c()
public Type_c(TypeSystem ts)
public Type_c(TypeSystem ts,
Position pos)
| Method Detail |
|---|
public abstract java.lang.String translate(Resolver c)
translate in interface Typec - A resolver in which to lookup this type to determine if
the type is unique in the given resolver.public boolean isType()
Qualifier
isType in interface Qualifierpublic boolean isPackage()
Qualifier
isPackage in interface Qualifierpublic Type toType()
Qualifier
toType in interface Qualifierpublic Package toPackage()
Qualifier
toPackage in interface Qualifierpublic boolean isCanonical()
TypeObject
isCanonical in interface TypeObjectpublic boolean isPrimitive()
Type
isPrimitive in interface Typepublic boolean isNumeric()
Type
isNumeric in interface Typepublic boolean isIntOrLess()
Type
isIntOrLess in interface Typepublic boolean isLongOrLess()
Type
isLongOrLess in interface Typepublic boolean isVoid()
Type
isVoid in interface Typepublic boolean isBoolean()
Type
isBoolean in interface Typepublic boolean isChar()
Type
isChar in interface Typepublic boolean isByte()
Type
isByte in interface Typepublic boolean isShort()
Type
isShort in interface Typepublic boolean isInt()
Type
isInt in interface Typepublic boolean isLong()
Type
isLong in interface Typepublic boolean isFloat()
Type
isFloat in interface Typepublic boolean isDouble()
Type
isDouble in interface Typepublic boolean isReference()
Type
isReference in interface Typepublic boolean isNull()
Type
isNull in interface Typepublic boolean isClass()
Type
isClass in interface Typepublic boolean isArray()
Type
isArray in interface Typepublic boolean isThrowable()
isThrowable in interface Typepublic boolean isUncheckedException()
isUncheckedException in interface Typepublic ClassType toClass()
toClass in interface Typepublic NullType toNull()
toNull in interface Typepublic ReferenceType toReference()
toReference in interface Typepublic PrimitiveType toPrimitive()
toPrimitive in interface Typepublic ArrayType toArray()
toArray in interface Typepublic ArrayType arrayOf(int dims)
dims-array of this type.
arrayOf in interface Typepublic ArrayType arrayOf()
arrayOf in interface Typepublic final boolean isSubtype(Type t)
ancestor.
isSubtype in interface Typepublic boolean isSubtypeImpl(Type t)
ancestor.
isSubtypeImpl in interface Typepublic final boolean descendsFrom(Type t)
ancestor.
descendsFrom in interface Typepublic boolean descendsFromImpl(Type t)
ancestor.
descendsFromImpl in interface Typepublic final boolean isCastValid(Type toType)
toType.
isCastValid in interface Typepublic boolean isCastValidImpl(Type toType)
toType.
isCastValidImpl in interface Typepublic final boolean isImplicitCastValid(Type toType)
toType.
isImplicitCastValid in interface Typepublic boolean isImplicitCastValidImpl(Type toType)
toType.
isImplicitCastValidImpl in interface Typepublic final boolean numericConversionValid(long value)
value can be converted to this type.
This method should be removed. It is kept for backward compatibility.
numericConversionValid in interface Typepublic boolean numericConversionValidImpl(long value)
value can be converted to this type.
This method should be removed. It is kept for backward compatibility.
numericConversionValidImpl in interface Typepublic final boolean numericConversionValid(java.lang.Object value)
value can be converted to this type.
numericConversionValid in interface Typepublic boolean numericConversionValidImpl(java.lang.Object value)
value can be converted to this type.
numericConversionValidImpl in interface Typepublic boolean isComparable(Type t)
isComparable in interface Typepublic abstract java.lang.String toString()
toString in interface TypetoString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||