Package de.svws_nrw.transpiler
Klasse ExpressionArrayType
java.lang.Object
de.svws_nrw.transpiler.ExpressionType
de.svws_nrw.transpiler.ExpressionArrayType
- Alle implementierten Schnittstellen:
ArrayTypeTree
,Tree
The specialized
ExpressionType
if the type is an array type.-
Verschachtelte Klassen - Übersicht
-
Konstruktorübersicht
KonstruktorBeschreibungExpressionArrayType
(ExpressionType type, long dim) Creates a new instance of the array expression type with the specified element type and the specified number of dimensions. -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungboolean
Returns whether the object parameter ist equal to this expression type or notThis method returns the expression type if the array subscript operator [?]static int
getDimension
(String typeString) Returns the number of dimensions used in the specified type string (e.g.long
Returns the number of dimensions of the array typegetType()
int
hashCode()
Returns the hashCode for the expression type.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
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, isIntegerType, isNumberType, isString
-
Konstruktordetails
-
ExpressionArrayType
Creates a new instance of the array expression type with the specified element type and the specified number of dimensions. If the element type is an array expression type, its element type is reused and its number of dimensions is added to the number of dimensions specified in the constrcutor parameter.- Parameter:
type
- the element typedim
- the number of dimensions
-
-
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
-
isAssignable
Beschreibung aus Klasse kopiert:ExpressionType
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.- Angegeben von:
isAssignable
in KlasseExpressionType
- 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.
-
getDimension
Returns the number of dimensions used in the specified type string (e.g. "int[][]").- Parameter:
typeString
- the type string- Gibt zurück:
- the number of dimensions
-
getAccessed
This method returns the expression type if the array subscript operator [?] is used on a variable of this expression type. This can either be the element type or an array expression type if this array is a multidimensional array. Effectively the number of dimensions is reduced by one.- Gibt zurück:
- the expression type after using the array subscript operator
-
getDimensions
public long getDimensions()Returns the number of dimensions of the array type- Gibt zurück:
- the number of dimensions
-
getType
- Angegeben von:
getType
in SchnittstelleArrayTypeTree
-
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
-