Class IA1MrStrategy.IA1MrReferent<N,E,T,B,VB extends B,FB extends B,MB extends B,TB extends B,S,I,QI,EV,PP,R extends RelatedExpression<N,T,B,TB,S,QI,R>,A extends ASTBasedAnaphora<N,E,T,B,TB,S,I,QI,R,A>>
java.lang.Object
de.monochromata.anaphors.ast.feature.DefaultFeatureContainer<QI>
de.monochromata.anaphors.ast.reference.AbstractReferent<N,E,T,B,VB,FB,MB,TB,S,I,QI,R,A>
de.monochromata.anaphors.ast.strategy.IA1MrStrategy.IA1MrReferent<N,E,T,B,VB,FB,MB,TB,S,I,QI,EV,PP,R,A>
- All Implemented Interfaces:
FeatureContainer<QI>,Referent<TB,S,I,QI>
- Enclosing class:
- IA1MrStrategy<N,E,T,B,VB extends B,FB extends B,MB extends B,TB extends B,S,I,QI,EV,PP,R extends RelatedExpression<N,T,B,TB,S,QI,R>,A extends ASTBasedAnaphora<N,E,T,B,TB,S,I,QI,R,A>>
public static class IA1MrStrategy.IA1MrReferent<N,E,T,B,VB extends B,FB extends B,MB extends B,TB extends B,S,I,QI,EV,PP,R extends RelatedExpression<N,T,B,TB,S,QI,R>,A extends ASTBasedAnaphora<N,E,T,B,TB,S,I,QI,R,A>> extends AbstractReferent<N,E,T,B,VB,FB,MB,TB,S,I,QI,R,A>
-
Field Summary
Fields inherited from class de.monochromata.anaphors.ast.reference.AbstractReferent
anaphorResolutionSpi -
Constructor Summary
Constructors Modifier Constructor Description protectedIA1MrReferent()Used in contract testing. -
Method Summary
Modifier and Type Method Description booleancanBeUsedInsteadOf(Referent<TB,S,I,QI> other)Used to resolve ambiguity between referents.booleanequals(Object obj)ObjectgetMemento()Return an object whoseObject.toString()method returns a representation of the internal state of the referent that can be passed toAnaphorResolutionStrategy.createReferent(Object, de.monochromata.anaphors.ast.relatedexp.RelatedExpression, Object)TODO: UseRelatedExpressionsSpimethods to convert the memento to a String and back, or create a ReferentSpi.MBgetMethodBinding()IgetMethodName()Returns the name of the method invocation which creates this referent, ifReferent.hasMethodName()returns true.QIgetName()Returns the name of this referent.inthashCode()booleanhasMethodName()Returns true, if this referent is created by a method invocation.booleanhasName()TBresolveType(S scope)The type of the referent - is identical to the return type, if the referent is a method.StringtoString()Methods inherited from class de.monochromata.anaphors.ast.reference.AbstractReferent
getDescription, getRelatedExpressionMethods inherited from class de.monochromata.anaphors.ast.feature.DefaultFeatureContainer
add, addAll, containsFeaturesOf, getFeatures, isEmpty, remove, removeAllMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface de.monochromata.anaphors.ast.feature.FeatureContainer
containsFeaturesOf, getFeatures, isEmpty
-
Constructor Details
-
IA1MrReferent
protected IA1MrReferent()Used in contract testing.
-
-
Method Details
-
getMethodBinding
-
canBeUsedInsteadOf
Description copied from interface:ReferentUsed 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
otherand this related expression should be used instead ofotherin order to eliminate the ambiguity between the two. False is returned otherwise.
-
hasName
-
getName
Description copied from interface:ReferentReturns the name of this referent. IfReferent.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.
-
hasMethodName
Description copied from interface:ReferentReturns 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:
Referent.getMethodName()
-
getMethodName
Description copied from interface:ReferentReturns the name of the method invocation which creates this referent, ifReferent.hasMethodName()returns true. TODO: Maybe replace by a system of thematic roles- Returns:
- The method name.
-
resolveType
Description copied from interface:ReferentThe 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
Description copied from interface:ReferentReturn an object whoseObject.toString()method returns a representation of the internal state of the referent that can be passed toAnaphorResolutionStrategy.createReferent(Object, de.monochromata.anaphors.ast.relatedexp.RelatedExpression, Object)TODO: UseRelatedExpressionsSpimethods to convert the memento to a String and back, or create a ReferentSpi.- Returns:
- A memento object.
-
hashCode
-
equals
-
toString
-