Package de.svws_nrw.transpiler
Klasse ExpressionType
java.lang.Object
de.svws_nrw.transpiler.ExpressionType
- Alle implementierten Schnittstellen:
Tree
- Bekannte direkte Unterklassen:
ExpressionArrayType
,ExpressionClassType
,ExpressionPackageType
,ExpressionPrimitiveType
,ExpressionTypeLambda
,ExpressionTypeNone
,ExpressionTypeNull
,ExpressionTypeVar
The base class for all types of expressions that were evaluated by the transpiler.
-
Verschachtelte Klassen - Übersicht
-
Konstruktorübersicht
ModifiziererKonstruktorBeschreibungprotected
ExpressionType
(Tree.Kind kind) Create a new expression type of the specified kind -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungfinal <R,
D> R accept
(TreeVisitor<R, D> visitor, D data) boolean
Returns whether the object parameter ist equal to this expression type or notstatic ExpressionType
getExpressionType
(Transpiler transpiler, Tree type) Determines the expression type for the specified abstract syntax tree (AST) node specified by the parameter type.static ExpressionType
getExpressionType
(Transpiler transpiler, TypeMirror type) Determines the expression type for the specified abstract syntax tree (AST) node specified by the parameter 'type'.getKind()
Returns the kind of the compiler tree elementint
hashCode()
Returns the hashCode for the expression type.abstract int
isAssignable
(Transpiler transpiler, ExpressionType other) Checks whether a values of the specified type other is assignable to a variable of this type or not.boolean
Checks whether this type is an integer type.boolean
Checks whether this type is a numeric or boxed numeric type.abstract boolean
Returns whether the type is a primitive type or a boxed primitive type.boolean
isString()
Checks whether this type is the String type.
-
Konstruktordetails
-
ExpressionType
Create a new expression type of the specified kind- Parameter:
kind
- the type kind
-
-
Methodendetails
-
getKind
Returns the kind of the compiler tree element -
accept
-
isAssignable
Checks whether a values of the specified type other is assignable to a variable of this type or not. If a value of that type is not assignable a negative value is returned. A zero or positive value is returned if it is assignable. A zero value indicates a perfect type match and greater values indicate a less perfect type match, e.g. unboxing of a primitive type is required or the a value of a sub class type should be assigned.- Parameter:
transpiler
- the transpiler object used for utility methodsother
- the other type- Gibt zurück:
- a postive value or zero if the type is assignable and a negative value if not.
-
isPrimitiveOrBoxedPrimitive
public abstract boolean isPrimitiveOrBoxedPrimitive()Returns whether the type is a primitive type or a boxed primitive type.- Gibt zurück:
- true if it is a primitive type and false otherwise
-
isString
public boolean isString()Checks whether this type is the String type.- Gibt zurück:
- true if it a string and false otherwise.
-
isNumberType
public boolean isNumberType()Checks whether this type is a numeric or boxed numeric type. The method is an override in the subclassesExpressionPrimitiveType
andExpressionClassType
.- Gibt zurück:
- true if it is a numeric type and false otherwise.
-
isIntegerType
public boolean isIntegerType()Checks whether this type is an integer type. The method is an override in the subclassesExpressionPrimitiveType
andExpressionClassType
.- Gibt zurück:
- true if it is an integer type and false otherwise.
-
getExpressionType
public static ExpressionType getExpressionType(Transpiler transpiler, TypeMirror type) throws TranspilerException Determines the expression type for the specified abstract syntax tree (AST) node specified by the parameter 'type'.- Parameter:
transpiler
- the transpiler used for determining the expression typetype
- the type mirror of the AST node- Gibt zurück:
- the expression type
- Löst aus:
TranspilerException
- an exception if the expression type cannot be determined
-
getExpressionType
public static ExpressionType getExpressionType(Transpiler transpiler, Tree type) throws TranspilerException Determines the expression type for the specified abstract syntax tree (AST) node specified by the parameter type.- Parameter:
transpiler
- the transpiler used for determining the expression typetype
- the AST node- Gibt zurück:
- the expression type
- Löst aus:
TranspilerException
- an exception if the expression type cannot be determined
-
hashCode
public int hashCode()Returns the hashCode for the expression type. -
equals
Returns whether the object parameter ist equal to this expression type or not
-