Interface Referent<TB,​S,​I,​QI>

Type Parameters:
TB - The type binding type
S - The scope type (optional)
I - The type used to represent identifiers
QI - The type used to represent qualified identifiers
All Superinterfaces:
FeatureContainer<QI>
All Known Implementing Classes:
AbstractReferent, DA1ReStrategy.DA1Referent, IA1MrStrategy.IA1MrReferent, IA2FStrategy.IA2FReferent, IA2MgStrategy.IA2MgReferent

public interface Referent<TB,​S,​I,​QI>
extends FeatureContainer<QI>
The representation of a referent. A referent may provide a number of features.
  • Method Details

    • canBeUsedInsteadOf

      boolean canBeUsedInsteadOf​(Referent<TB,​S,​I,​QI> other)
      Used to resolve ambiguity between referents. Cases of resolvable ambiguity include e.g. a referent that represents the invocation of a getter method that returns the value of the field that is represented by another referent.
      Parameters:
      other - Another referent.
      Returns:
      True, if this referent represents 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

      boolean hasName()
    • getName

      Returns the name of this referent. If hasMethodName() returns true and the method name is the only name of this referent, this method returns a name constructed from the method name. That name is constructed by removing any getter or setter prefix to the method name and by turning the first character of the remaining string into lower case.
      Returns:
      The name of this referent.
      Throws:
      UnsupportedOperationException - If hasName() returns false.
    • hasMethodName

      boolean hasMethodName()
      Returns true, if this referent is created by a method invocation. TODO: Maybe replace by a system of thematic roles
      Returns:
      True, if the referent is created by a method invocation, false otherwise.
      See Also:
      getMethodName()
    • getMethodName

      Returns the name of the method invocation which creates this referent, if hasMethodName() returns true. TODO: Maybe replace by a system of thematic roles
      Returns:
      The method name.
      Throws:
      UnsupportedOperationException - If hasMethodName() returns false.
    • resolveType

      TB resolveType​(S scope)
      The type of the referent - is identical to the return type, if the referent is a method.
      Parameters:
      scope - The scope containing the referent 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 type binding of the referent.
    • getMemento

      Return an object whose Object.toString() method returns a representation of the internal state of the referent that can be passed to AnaphorResolutionStrategy.createReferent(Object, de.monochromata.anaphors.ast.relatedexp.RelatedExpression, Object) TODO: Use RelatedExpressionsSpi methods to convert the memento to a String and back, or create a ReferentSpi.
      Returns:
      A memento object.
    • getDescription