|
|||||||||
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 polyglot.ext.jl.types.PrimitiveType_c
public class PrimitiveType_c
An PrimitiveType_c
represents a primitive type.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface polyglot.types.PrimitiveType |
---|
PrimitiveType.Kind |
Field Summary | |
---|---|
protected PrimitiveType.Kind |
kind
|
Fields inherited from class polyglot.ext.jl.types.TypeObject_c |
---|
position, ts |
Fields inherited from interface polyglot.types.PrimitiveType |
---|
BOOLEAN, BYTE, CHAR, DOUBLE, FLOAT, INT, LONG, SHORT, VOID |
Constructor Summary | |
---|---|
protected |
PrimitiveType_c()
Used for deserializing types. |
|
PrimitiveType_c(TypeSystem ts,
PrimitiveType.Kind kind)
|
Method Summary | |
---|---|
boolean |
descendsFromImpl(Type ancestor)
Return true if this type descends from ancestor . |
boolean |
equalsImpl(TypeObject t)
Default implementation is pointer equality. |
java.lang.String |
fullName()
Full dotted-name of the type object. |
int |
hashCode()
|
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 |
isCastValidImpl(Type toType)
Requires: all type arguments are canonical. |
boolean |
isChar()
Return true if char. |
boolean |
isDouble()
Return true if double. |
boolean |
isFloat()
Return true if float. |
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 |
isNumeric()
Return true if double, float, long, int, short, byte, or char. |
boolean |
isPrimitive()
Return true if a primitive type. |
boolean |
isShort()
Return true if short. |
boolean |
isVoid()
Return true if void. |
PrimitiveType.Kind |
kind()
The kind of primitive. |
java.lang.String |
name()
Simple name of the type object. |
boolean |
numericConversionValidImpl(long value)
Returns true if literal value value can be converted to
this primitive type. |
boolean |
numericConversionValidImpl(java.lang.Object value)
Returns true if literal value value can be converted to
this primitive type. |
PrimitiveType |
toPrimitive()
Returns a non-null iff isPrimitive() returns true. |
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. |
java.lang.String |
wrapperTypeString(TypeSystem ts)
A string representing the type used to box this primitive. |
Methods inherited from class polyglot.ext.jl.types.Type_c |
---|
arrayOf, arrayOf, descendsFrom, isArray, isCastValid, isClass, isComparable, isImplicitCastValid, isNull, isPackage, isReference, isSubtype, isSubtypeImpl, isThrowable, isType, isUncheckedException, numericConversionValid, numericConversionValid, toArray, toClass, toNull, toPackage, toReference, toType |
Methods inherited from class polyglot.ext.jl.types.TypeObject_c |
---|
copy, equals, position, typeSystem |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface polyglot.types.Type |
---|
arrayOf, arrayOf, descendsFrom, isArray, isCastValid, isClass, isComparable, isImplicitCastValid, isNull, isReference, isSubtype, isSubtypeImpl, isThrowable, isUncheckedException, numericConversionValid, numericConversionValid, toArray, toClass, toNull, toReference |
Methods inherited from interface polyglot.types.Qualifier |
---|
isPackage, isType, toPackage, toType |
Methods inherited from interface polyglot.types.TypeObject |
---|
position, typeSystem |
Methods inherited from interface polyglot.util.Copy |
---|
copy |
Field Detail |
---|
protected PrimitiveType.Kind kind
Constructor Detail |
---|
protected PrimitiveType_c()
public PrimitiveType_c(TypeSystem ts, PrimitiveType.Kind kind)
Method Detail |
---|
public PrimitiveType.Kind kind()
PrimitiveType
kind
in interface PrimitiveType
public java.lang.String toString()
Type_c
toString
in interface Type
toString
in class Type_c
public java.lang.String translate(Resolver c)
Type_c
translate
in interface Type
translate
in class Type_c
c
- A resolver in which to lookup this type to determine if
the type is unique in the given resolver.public boolean isCanonical()
TypeObject
isCanonical
in interface TypeObject
isCanonical
in class Type_c
public boolean isPrimitive()
Type
isPrimitive
in interface Type
isPrimitive
in class Type_c
public PrimitiveType toPrimitive()
Type_c
toPrimitive
in interface Type
toPrimitive
in class Type_c
public boolean isVoid()
Type
isVoid
in interface Type
isVoid
in class Type_c
public boolean isBoolean()
Type
isBoolean
in interface Type
isBoolean
in class Type_c
public boolean isChar()
Type
isChar
in interface Type
isChar
in class Type_c
public boolean isByte()
Type
isByte
in interface Type
isByte
in class Type_c
public boolean isShort()
Type
isShort
in interface Type
isShort
in class Type_c
public boolean isInt()
Type
isInt
in interface Type
isInt
in class Type_c
public boolean isLong()
Type
isLong
in interface Type
isLong
in class Type_c
public boolean isFloat()
Type
isFloat
in interface Type
isFloat
in class Type_c
public boolean isDouble()
Type
isDouble
in interface Type
isDouble
in class Type_c
public boolean isIntOrLess()
Type
isIntOrLess
in interface Type
isIntOrLess
in class Type_c
public boolean isLongOrLess()
Type
isLongOrLess
in interface Type
isLongOrLess
in class Type_c
public boolean isNumeric()
Type
isNumeric
in interface Type
isNumeric
in class Type_c
public int hashCode()
hashCode
in class TypeObject_c
public boolean equalsImpl(TypeObject t)
TypeObject_c
equalsImpl
in interface TypeObject
equalsImpl
in class TypeObject_c
TypeObject_c.equalsImpl(TypeObject)
,
Object.hashCode()
public java.lang.String wrapperTypeString(TypeSystem ts)
PrimitiveType
wrapperTypeString
in interface PrimitiveType
public java.lang.String name()
Named
name
in interface Named
public java.lang.String fullName()
Named
fullName
in interface Named
public boolean descendsFromImpl(Type ancestor)
Type_c
ancestor
.
descendsFromImpl
in interface Type
descendsFromImpl
in class Type_c
public boolean isImplicitCastValidImpl(Type toType)
Type_c
toType
.
isImplicitCastValidImpl
in interface Type
isImplicitCastValidImpl
in class Type_c
public boolean isCastValidImpl(Type toType)
isCastValidImpl
in interface Type
isCastValidImpl
in class Type_c
public boolean numericConversionValidImpl(long value)
value
can be converted to
this primitive type. This method should be removed. It is kept
for backward compatibility.
numericConversionValidImpl
in interface Type
numericConversionValidImpl
in class Type_c
public boolean numericConversionValidImpl(java.lang.Object value)
value
can be converted to
this primitive type.
numericConversionValidImpl
in interface Type
numericConversionValidImpl
in class Type_c
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |