public class PrimitiveType_c extends Type_c implements PrimitiveType
PrimitiveType represents a type which may not be directly
coerced to java.lang.Object (under the standard Java type system).
This class should never be instantiated directly. Instead, you should
use the TypeSystem.get* methods.
PrimitiveType.Kind| Modifier and Type | Field and Description |
|---|---|
protected PrimitiveType.Kind |
kind |
position, ts| Modifier | Constructor and Description |
|---|---|
protected |
PrimitiveType_c()
Used for deserializing types.
|
|
PrimitiveType_c(TypeSystem ts,
PrimitiveType.Kind kind) |
| Modifier and Type | Method and Description |
|---|---|
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(java.lang.Object value)
Return true a literal
value can be converted to this type. |
PrimitiveType |
toPrimitive()
Cast the type to a primitive 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.
|
boolean |
typeEqualsImpl(Type t)
Return true if this type is equivalent to t.
|
java.lang.String |
wrapperTypeString(TypeSystem ts)
A string representing the type used to box this primitive.
|
arrayOf, arrayOf, descendsFrom, isArray, isCastValid, isClass, isComparable, isImplicitCastValid, isNull, isPackage, isReference, isSubtype, isSubtypeImpl, isThrowable, isType, isUncheckedException, numericConversionValid, numericConversionValid, numericConversionValidImpl, print, toArray, toClass, toNull, toPackage, toReference, toType, typeEqualscopy, equals, position, typeSystemclone, finalize, getClass, notify, notifyAll, wait, wait, waitarrayOf, arrayOf, descendsFrom, isArray, isCastValid, isClass, isComparable, isImplicitCastValid, isNull, isReference, isSubtype, isSubtypeImpl, isThrowable, isUncheckedException, numericConversionValid, numericConversionValid, numericConversionValidImpl, print, toArray, toClass, toNull, toReference, typeEqualsposition, typeSystemprotected PrimitiveType.Kind kind
protected PrimitiveType_c()
public PrimitiveType_c(TypeSystem ts, PrimitiveType.Kind kind)
public PrimitiveType.Kind kind()
PrimitiveTypekind in interface PrimitiveTypepublic java.lang.String toString()
Typepublic java.lang.String translate(Resolver c)
Typepublic boolean isCanonical()
TypeObjectisCanonical in interface TypeObjectisCanonical in class Type_cpublic boolean isPrimitive()
TypeisPrimitive in interface TypeisPrimitive in class Type_cpublic PrimitiveType toPrimitive()
TypetoPrimitive in interface TypetoPrimitive in class Type_cisPrimitive() returns true.public boolean isVoid()
Typepublic boolean isBoolean()
Typepublic boolean isChar()
Typepublic boolean isByte()
Typepublic boolean isShort()
Typepublic boolean isInt()
Typepublic boolean isLong()
Typepublic boolean isFloat()
Typepublic boolean isDouble()
Typepublic boolean isIntOrLess()
TypeisIntOrLess in interface TypeisIntOrLess in class Type_cpublic boolean isLongOrLess()
TypeisLongOrLess in interface TypeisLongOrLess in class Type_cpublic boolean isNumeric()
Typepublic int hashCode()
hashCode in class TypeObject_cpublic boolean equalsImpl(TypeObject t)
TypeObject_cequalsImpl in interface TypeObjectequalsImpl in class TypeObject_cTypeObject_c.equalsImpl(TypeObject),
Object.hashCode()public boolean typeEqualsImpl(Type t)
TypetypeEqualsImpl in interface TypetypeEqualsImpl in class Type_ct - Type to compare topublic java.lang.String wrapperTypeString(TypeSystem ts)
PrimitiveTypewrapperTypeString in interface PrimitiveTypepublic java.lang.String name()
Namedpublic java.lang.String fullName()
Namedpublic boolean descendsFromImpl(Type ancestor)
Typeancestor.descendsFromImpl in interface TypedescendsFromImpl in class Type_cpublic boolean isImplicitCastValidImpl(Type toType)
TypetoType.isImplicitCastValidImpl in interface TypeisImplicitCastValidImpl in class Type_cpublic boolean isCastValidImpl(Type toType)
isCastValidImpl in interface TypeisCastValidImpl in class Type_cpublic boolean numericConversionValidImpl(java.lang.Object value)
Typevalue can be converted to this type.numericConversionValidImpl in interface TypenumericConversionValidImpl in class Type_c