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