Interface RelatedExpression<N,​T,​B,​TB extends B,​S,​QI,​R extends RelatedExpression<N,​T,​B,​TB,​S,​QI,​R>>

Type Parameters:
N - The node type in the AST
T - The type type
B - The binding type
TB - The type binding type
S - The scope type (optional)
QI - The type used to represent qualified identifiers
R - The sub-type of related expression to use
All Known Implementing Classes:
DefaultRelatedExpression

public interface RelatedExpression<N,​T,​B,​TB extends B,​S,​QI,​R extends RelatedExpression<N,​T,​B,​TB,​S,​QI,​R>>
Represents the function of an expression, or statement as related expression.
  • Method Details

    • isEffectivelyFinal

      If the related expression is effectively final, its value is identical at run-time, regardless of whether the related expression occurs in its original position, or would be moved or copied to the position of the anaphor.
      Returns:
      true, if the related expression is effectively final.
    • shouldResolutionReplaceRelatedExpressionWithTempDeclaration

      Returns:
      true, if anaphor resolution should replace the related expression with a declaration of a temporary local variable. This is required whenever the related expression is not effectively final and is not already used to initialize an effectively final local variable that can be re-used.
      See Also:
      isEffectivelyFinal()
    • getRelatedExpression

    • setRelatedExpression

      @Deprecated void setRelatedExpression​(N relatedExpression)
      Deprecated.
      Replaces the current related expression with the given one.
      Parameters:
      relatedExpression - The new related expression
      See Also:
      getRelatedExpression(), getStrategy()
    • getStrategy

      RelatedExpressionStrategy<N,​T,​B,​TB,​S,​QI,​R> getStrategy()
    • canBeUsedInsteadOf

      boolean canBeUsedInsteadOf​(R other)
      Used to resolve referential ambiguity between related expressions.
      Parameters:
      other - Another related expression.
      Returns:
      True, if this related expression refers to the same referent as other and this related expression should be used instead of other in order to eliminate the ambiguity between the two. False is returned otherwise.
    • hasName

      default boolean hasName()
      Whether or not this related expression declares a name.
      Returns:
      True, if a name is declared, false otherwise.
    • getName

      Return the name used as identifier in the related expression, if the related expression declares a name. Null is returned, if hasName() returns false.
      Returns:
      Null, if hasName() returns false.
      See Also:
      hasName()
    • getPartNames

    • getAssociateNames

    • getContainedNamesFromSurface

    • resolveNameBinding

      B resolveNameBinding​(S scope)
      Resolves the binding of the name declared in the related expression. Returns null, if hasName() returns false.
      Parameters:
      scope - The scope containing the related expression if used by the compiler-specific implementation. Implementations of this method must not access the scope but merely pass it on to SPI's they invoke.
      Returns:
      The resolved binding.
    • getLengthOfTypeForTempVar

    • getTypeForTempVar

      @Deprecated T getTypeForTempVar​(S scope, Function<TB,​T> importRewrite)
      Deprecated.
      Returns the type of the related expression for use in declaring a local temporary variable. This method needs to add import declarations if necessary to make the type useable for the temp var.
      Parameters:
      importRewrite - To turn a type binding into a type that can be used in the AST
    • resolveType

      TB resolveType​(S scope)
      Resolve the type of the related expression
      Parameters:
      scope - The scope containing the related expression if used by the compiler-specific implementation. Implementations of this method must not access the scope but merely pass it on to SPI's they invoke.
      Returns:
      The resolved type.
    • resolvePartTypes

      List<TB> resolvePartTypes​(S scope)
    • resolveAssociateTypes

    • resolveContainedTypesFromSurface

    • getDescription

    • getLine

      int getLine()
    • getColumn

      int getColumn()