Klasse ExpressionTypeVar

java.lang.Object
de.svws_nrw.transpiler.ExpressionType
de.svws_nrw.transpiler.ExpressionTypeVar
Alle implementierten Schnittstellen:
Tree

public final class ExpressionTypeVar extends ExpressionType
The specialized ExpressionType if the type is a type variable, e.g. the type variable "T" used in the type "Comparable T".
  • 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.
    • getExpressionTypeVariable

      public static ExpressionTypeVar getExpressionTypeVariable(Transpiler transpiler, Tree type) throws TranspilerException
      Creates a new type variable expression type instance from the specified Tree
      Parameter:
      transpiler - the transpiler used for determining the expression type
      type - the type tree node
      Gibt zurück:
      the new type variable expression type instance
      Löst aus:
      TranspilerException - an exception if analyzing the type arguments fails
    • getWildcardExpressionTypeVariable

      public static ExpressionTypeVar getWildcardExpressionTypeVariable()
      Creates a new wildcard (?) type variable expression type instance.
      Gibt zurück:
      the new type variable expression type instance
    • getExpressionTypeVariable

      public static ExpressionTypeVar getExpressionTypeVariable(Transpiler transpiler, TypeMirror type) throws TranspilerException
      Creates a new type variable expression type instance from the specified TypeMirror
      Parameter:
      transpiler - the transpiler used for determining the expression type
      type - the type mirror
      Gibt zurück:
      the new type variable expression type instance
      Löst aus:
      TranspilerException - an exception if analyzing the type arguments fails
    • isWildcard

      public boolean isWildcard()
      Returns true if this type variable is a wildcard type with or without bounds (extends or super).
      Gibt zurück:
      true if this type varirable ist a wildcard type variable and false otherwise
    • getName

      public String getName()
      Returns the name of the type variable
      Gibt zurück:
      the name of the type variable
    • getExtendsBound

      public ExpressionType getExtendsBound()
      Returns the extends bound expression type if this type variable is a wildcard type of kind '? extends T'.
      Gibt zurück:
      the extends bound
    • getSuperBound

      public ExpressionType getSuperBound()
      Returns the super bound expression type if this type variable is a wildcard type of kind '? super T'.
      Gibt zurück:
      the super bound expression type
    • 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