|
|||||||||
| 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
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 PrimitiveTypepublic java.lang.String toString()
Type_c
toString in interface TypetoString in class Type_cpublic java.lang.String translate(Resolver c)
Type_c
translate in interface Typetranslate in class Type_cc - 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 TypeObjectisCanonical in class Type_cpublic boolean isPrimitive()
Type
isPrimitive in interface TypeisPrimitive in class Type_cpublic PrimitiveType toPrimitive()
Type_c
toPrimitive in interface TypetoPrimitive in class Type_cpublic boolean isVoid()
Type
isVoid in interface TypeisVoid in class Type_cpublic boolean isBoolean()
Type
isBoolean in interface TypeisBoolean in class Type_cpublic boolean isChar()
Type
isChar in interface TypeisChar in class Type_cpublic boolean isByte()
Type
isByte in interface TypeisByte in class Type_cpublic boolean isShort()
Type
isShort in interface TypeisShort in class Type_cpublic boolean isInt()
Type
isInt in interface TypeisInt in class Type_cpublic boolean isLong()
Type
isLong in interface TypeisLong in class Type_cpublic boolean isFloat()
Type
isFloat in interface TypeisFloat in class Type_cpublic boolean isDouble()
Type
isDouble in interface TypeisDouble in class Type_cpublic boolean isIntOrLess()
Type
isIntOrLess in interface TypeisIntOrLess in class Type_cpublic boolean isLongOrLess()
Type
isLongOrLess in interface TypeisLongOrLess in class Type_cpublic boolean isNumeric()
Type
isNumeric in interface TypeisNumeric in class Type_cpublic int hashCode()
hashCode in class TypeObject_cpublic boolean equalsImpl(TypeObject t)
TypeObject_c
equalsImpl in interface TypeObjectequalsImpl in class TypeObject_cTypeObject_c.equalsImpl(TypeObject),
Object.hashCode()public java.lang.String wrapperTypeString(TypeSystem ts)
PrimitiveType
wrapperTypeString in interface PrimitiveTypepublic java.lang.String name()
Named
name in interface Namedpublic java.lang.String fullName()
Named
fullName in interface Namedpublic boolean descendsFromImpl(Type ancestor)
Type_cancestor.
descendsFromImpl in interface TypedescendsFromImpl in class Type_cpublic boolean isImplicitCastValidImpl(Type toType)
Type_ctoType.
isImplicitCastValidImpl in interface TypeisImplicitCastValidImpl in class Type_cpublic boolean isCastValidImpl(Type toType)
isCastValidImpl in interface TypeisCastValidImpl in class Type_cpublic 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 TypenumericConversionValidImpl in class Type_cpublic boolean numericConversionValidImpl(java.lang.Object value)
value can be converted to
this primitive type.
numericConversionValidImpl in interface TypenumericConversionValidImpl in class Type_c
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||