Klasse ExpressionArrayType

java.lang.Object
de.svws_nrw.transpiler.ExpressionType
de.svws_nrw.transpiler.ExpressionArrayType
Alle implementierten Schnittstellen:
ArrayTypeTree, Tree

public final class ExpressionArrayType extends ExpressionType implements ArrayTypeTree
The specialized ExpressionType if the type is an array type.
  • Konstruktordetails

    • ExpressionArrayType

      public ExpressionArrayType(ExpressionType type, long dim)
      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 type
      dim - 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 Klasse ExpressionType
      Gibt zurück:
      true if it is a primitive type and false otherwise
    • isAssignable

      public int isAssignable(Transpiler transpiler, ExpressionType other)
      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 Klasse ExpressionType
      Parameter:
      transpiler - the transpiler object used for utility methods
      other - the other type
      Gibt zurück:
      a postive value or zero if the type is assignable and a negative value if not.
    • getDimension

      public static int getDimension(String typeString)
      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

      public ExpressionType 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

      public Tree getType()
      Angegeben von:
      getType in Schnittstelle ArrayTypeTree
    • toString

      public String toString()
      Setzt außer Kraft:
      toString in Klasse Object
    • hashCode

      public int hashCode()
      Beschreibung aus Klasse kopiert: ExpressionType
      Returns the hashCode for the expression type.
      Setzt außer Kraft:
      hashCode in Klasse ExpressionType
      Gibt zurück:
      the hash code
    • equals

      public boolean equals(Object obj)
      Beschreibung aus Klasse kopiert: ExpressionType
      Returns whether the object parameter ist equal to this expression type or not
      Setzt außer Kraft:
      equals in Klasse ExpressionType
      Gibt zurück:
      true if both are equal