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

public abstract class ExpressionType extends Object implements Tree
The base class for all types of expressions that were evaluated by the transpiler.
  • Verschachtelte Klassen - Übersicht

    Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen com.sun.source.tree.Tree

    Tree.Kind
  • Konstruktorübersicht

    Konstruktoren
    Modifizierer
    Konstruktor
    Beschreibung
    protected
    Create a new expression type of the specified kind
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    final <R, D> R
    accept(TreeVisitor<R,D> visitor, D data)
     
    boolean
    Returns whether the object parameter ist equal to this expression type or not
    getExpressionType(Transpiler transpiler, Tree type)
    Determines the expression type for the specified abstract syntax tree (AST) node specified by the parameter type.
    Determines the expression type for the specified abstract syntax tree (AST) node specified by the parameter 'type'.
    Returns the kind of the compiler tree element
    int
    Returns the hashCode for the expression type.
    abstract int
    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
    Checks whether this type is the String type.

    Von Klasse geerbte Methoden java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Konstruktordetails

    • ExpressionType

      protected ExpressionType(Tree.Kind kind)
      Create a new expression type of the specified kind
      Parameter:
      kind - the type kind
  • Methodendetails

    • getKind

      public Tree.Kind getKind()
      Returns the kind of the compiler tree element
      Angegeben von:
      getKind in Schnittstelle Tree
      Gibt zurück:
      the tree kind of the expression type
    • accept

      public final <R, D> R accept(TreeVisitor<R,D> visitor, D data)
      Angegeben von:
      accept in Schnittstelle Tree
    • isAssignable

      public 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. 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 methods
      other - 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 subclasses ExpressionPrimitiveType and ExpressionClassType.
      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 subclasses ExpressionPrimitiveType and ExpressionClassType.
      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 type
      type - 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 type
      type - 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.
      Setzt außer Kraft:
      hashCode in Klasse Object
      Gibt zurück:
      the hash code
    • equals

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