Class FeatureRecurrence<N,E,CI extends N,B,TB extends B,S,I,QI,EV,PP>
java.lang.Object
de.monochromata.AbstractStrategy
de.monochromata.anaphors.ast.reference.strategy.AbstractReferentializationStrategy<N,E,TB,S,I,QI,EV,PP>
de.monochromata.anaphors.ast.reference.strategy.feature.FeatureRecurrence<N,E,CI,B,TB,S,I,QI,EV,PP>
- Type Parameters:
N- The node type in the ASTE- The expression typeCI- The class instance creation expression node typeB- The binding typeTB- The type binding typeS- The scope type (optional)I- The type used to represent identifiersQI- The type used to represent qualified identifiersEV- The type of the event contained in the condition that is evaluated to check when the perspectivations shall be applied.PP- The type used for positions that carry perspectivations
- All Implemented Interfaces:
FeatureReferentializationStrategy<E,TB,S,I,QI>,ReferentializationStrategy<E,TB,S,I,QI>,Strategy
public class FeatureRecurrence<N,E,CI extends N,B,TB extends B,S,I,QI,EV,PP> extends AbstractReferentializationStrategy<N,E,TB,S,I,QI,EV,PP> implements FeatureReferentializationStrategy<E,TB,S,I,QI>
Referentialization based on feature recurrence (i.e. matching referents whose
type is equal to a suffix of the simple name that acts as definite expression
and that declare a feature in the constructor invocation that recurs in the
non-empty prefix to the suffix of the simple name).
Note
TODO: Ensure non-empty prefix to the type name in the simple name TODO: Make sure all features from the simple name are found in the referent TODO: Collect features not only from the constructor, but also from other downstream accesses TODO: Implement matching of multiple features and flexible length of type names ...-
Field Summary
Fields Modifier and Type Field Description static StringRf_KIND_PREFIXFields inherited from class de.monochromata.anaphors.ast.reference.strategy.AbstractReferentializationStrategy
anaphorsSpi -
Constructor Summary
Constructors Modifier Constructor Description protectedFeatureRecurrence()Used in contract testing.FeatureRecurrence(ConceptReferentializationStrategy<E,TB,S,I,QI> delegate, AnaphorsSpi<N,E,TB,S,I,QI,EV,PP> anaphorsSpi) -
Method Summary
Modifier and Type Method Description booleancanReferTo(I idFromDefiniteExpression, Referent<TB,S,I,QI> potentialReferent, S scope)Checks whether the given definite expression can, using this referentialization strategy, refer to the given potential referent in the given scope.booleanequals(Object obj)ConceptReferentializationStrategy<E,TB,S,I,QI>getDelegate()Provides access to theConceptReferentializationStrategythat this feature referentialization strategy delegates to.StringgetKind()Returns a short mnemonic string that uniquely identifies this strategy among the type of strategies it belongs to.inthashCode()Methods inherited from class de.monochromata.AbstractStrategy
toString
-
Field Details
-
Rf_KIND_PREFIX
- See Also:
- Constant Field Values
-
-
Constructor Details
-
FeatureRecurrence
protected FeatureRecurrence()Used in contract testing. -
FeatureRecurrence
-
-
Method Details
-
canReferTo
public boolean canReferTo(I idFromDefiniteExpression, Referent<TB,S,I,QI> potentialReferent, S scope)Description copied from interface:ReferentializationStrategyChecks whether the given definite expression can, using this referentialization strategy, refer to the given potential referent in the given scope. All information in the definite expression needs to be matched by the given potential referent for the method to return true. Matching is performed in a way that is specific to the referentialization strategy.- Specified by:
canReferToin interfaceReferentializationStrategy<N,E,CI extends N,B,TB extends B>- Parameters:
idFromDefiniteExpression- the ID from the definite expression that shall refer to the given potential referentpotentialReferent- the potential referent to refer toscope- the scope in which the definite expression occurs- Returns:
trueif all information provided by the definite expression matches information provided by the potential referent, where matching depends on the implementation of this method,falseotherwise.
-
getDelegate
Description copied from interface:FeatureReferentializationStrategyProvides access to theConceptReferentializationStrategythat this feature referentialization strategy delegates to.- Specified by:
getDelegatein interfaceFeatureReferentializationStrategy<N,E,CI extends N,B,TB extends B>- Returns:
- the delegate
-
getKind
Description copied from interface:StrategyReturns a short mnemonic string that uniquely identifies this strategy among the type of strategies it belongs to. -
hashCode
- Overrides:
hashCodein classAbstractStrategy
-
equals
- Overrides:
equalsin classAbstractStrategy
-