Package de.svws_nrw.transpiler
Klasse ExpressionPrimitiveType
java.lang.Object
de.svws_nrw.transpiler.ExpressionType
de.svws_nrw.transpiler.ExpressionPrimitiveType
- Alle implementierten Schnittstellen:
PrimitiveTypeTree
,Tree
The specialized
ExpressionType
if the type is a primitive type.-
Verschachtelte Klassen - Übersicht
-
Konstruktorübersicht
KonstruktorBeschreibungCreates a primitive expression type instance for the specified primitive type string.ExpressionPrimitiveType
(TypeKind typeKind) Creates a primitive expression type instance for the specifiedTypeKind
. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungboolean
Returns whether the object parameter ist equal to this expression type or notstatic ExpressionPrimitiveType
Determines the primitive type for the primitive type string.static ExpressionPrimitiveType
Returns the primitive type of specified type if it is a primitive or boxed primitive type.static ExpressionPrimitiveType
getPromotedType
(ExpressionType type1, ExpressionType type2) Returns the unboxed binary numeric promotion type of the two specified type.static ExpressionPrimitiveType
getUnboxed
(ExpressionClassType classType) Determines the primitive type for the specified boxed class type.int
hashCode()
Returns the hashCode for the expression type.int
isAssignable
(Transpiler transpiler, ExpressionType other) Checks whether the specified primitive type other is assignable to this primitive type or not.boolean
Checks whether this type is an integer type.boolean
Checks whether this type is a numeric or boxed numeric type.boolean
Returns whether the type is a primitive type or a boxed primitive type.toString()
Von Klasse geerbte Methoden de.svws_nrw.transpiler.ExpressionType
accept, getExpressionType, getExpressionType, getKind, isString
-
Konstruktordetails
-
ExpressionPrimitiveType
Creates a primitive expression type instance for the specifiedTypeKind
.- Parameter:
typeKind
- the type kind of the primitive type- Löst aus:
TranspilerException
- an exception if the specified type kind is not a primitive type kind
-
ExpressionPrimitiveType
Creates a primitive expression type instance for the specified primitive type string.- Parameter:
type
- the primitive type string (e.g. "float")- Löst aus:
TranspilerException
- an exception if the specified type kind is not a primitive type kind
-
-
Methodendetails
-
isPrimitiveOrBoxedPrimitive
public boolean isPrimitiveOrBoxedPrimitive()Beschreibung aus Klasse kopiert:ExpressionType
Returns whether the type is a primitive type or a boxed primitive type.- Angegeben von:
isPrimitiveOrBoxedPrimitive
in KlasseExpressionType
- Gibt zurück:
- true if it is a primitive type and false otherwise
-
isNumberType
public boolean isNumberType()Beschreibung aus Klasse kopiert:ExpressionType
Checks whether this type is a numeric or boxed numeric type. The method is an override in the subclassesExpressionPrimitiveType
andExpressionClassType
.- Setzt außer Kraft:
isNumberType
in KlasseExpressionType
- Gibt zurück:
- true if it is a numeric type and false otherwise.
-
isIntegerType
public boolean isIntegerType()Beschreibung aus Klasse kopiert:ExpressionType
Checks whether this type is an integer type. The method is an override in the subclassesExpressionPrimitiveType
andExpressionClassType
.- Setzt außer Kraft:
isIntegerType
in KlasseExpressionType
- Gibt zurück:
- true if it is an integer type and false otherwise.
-
isAssignable
Checks whether the specified primitive type other is assignable to this primitive type or not.- Angegeben von:
isAssignable
in KlasseExpressionType
- Parameter:
transpiler
- the transpiler object used for utility methodsother
- the other primitive type- Gibt zurück:
- true if it is assignable and false otherwise
-
getPrimitiveTypeKind
- Angegeben von:
getPrimitiveTypeKind
in SchnittstellePrimitiveTypeTree
-
toString
-
hashCode
public int hashCode()Beschreibung aus Klasse kopiert:ExpressionType
Returns the hashCode for the expression type.- Setzt außer Kraft:
hashCode
in KlasseExpressionType
- Gibt zurück:
- the hash code
-
equals
Beschreibung aus Klasse kopiert:ExpressionType
Returns whether the object parameter ist equal to this expression type or not- Setzt außer Kraft:
equals
in KlasseExpressionType
- Gibt zurück:
- true if both are equal
-
getUnboxed
Determines the primitive type for the specified boxed class type. If the classType is invalid null is returned.- Parameter:
classType
- the class name of the boxed type- Gibt zurück:
- the unboxed primitive type or null on error
-
getPrimitiveType
Returns the primitive type of specified type if it is a primitive or boxed primitive type.- Parameter:
type
- the specified type- Gibt zurück:
- the primitive type or null
-
getPromotedType
Returns the unboxed binary numeric promotion type of the two specified type.- Parameter:
type1
- the first typetype2
- teh second type- Gibt zurück:
- the unboxed binary numeric promotion type
-
get
Determines the primitive type for the primitive type string. If the string does not represent a valid primitive type null is returned.- Parameter:
typeName
- the primitive type string- Gibt zurück:
- the primitive type or null on error
-