Class NameRecurrence<N,E,TB,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.concept.AbstractConceptReferentializationStrategy<N,E,TB,S,I,QI,EV,PP>
de.monochromata.anaphors.ast.reference.strategy.concept.NameRecurrence<N,E,TB,S,I,QI,EV,PP>
- Type Parameters:
N- The node type in the ASTE- The expression 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:
ConceptReferentializationStrategy<E,TB,S,I,QI>,ReferentializationStrategy<E,TB,S,I,QI>,Strategy
- Direct Known Subclasses:
CaseSensitiveNameRecurrence
public class NameRecurrence<N,E,TB,S,I,QI,EV,PP> extends AbstractConceptReferentializationStrategy<N,E,TB,S,I,QI,EV,PP>
Referentialization based on case-insensitive name recurrence.
-
Field Summary
Fields inherited from class de.monochromata.anaphors.ast.reference.strategy.AbstractReferentializationStrategy
anaphorsSpi -
Constructor Summary
Constructors Modifier Constructor Description protectedNameRecurrence()Used in contract testing.NameRecurrence(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)Returns true, if the given definite expression is a simple name, the given potential referent has a name, and the simple name is equal to the name of the referent.booleancanReferToUsingConceptualType(I idFromDefiniteExpression, Referent<TB,S,I,QI> potentialReferent, S scope)Returns true, if the given definite expression is a simple name, the given potential referent has a name, and the conceptual type expressed in the simple name is equal to the conceptual type expressed in the name of the referent.FeatureContainer<QI>getFeaturesRemainingInIdentifierIfItCanReferUsingConceptualType(I idFromDefiniteExpression, Referent<TB,S,I,QI> potentialReferent, S scope)IfConceptReferentializationStrategy.canReferToUsingConceptualType(Object, Referent, Object)returnstruefor the given arguments, there is a suffix in the given definite expression that represents a conceptual type and can be used to refer to the given potential referent.StringgetKind()Returns a short mnemonic string that uniquely identifies this strategy among the type of strategies it belongs to.protected booleanisCaseSensitive()Whether to match caseMethods inherited from class de.monochromata.AbstractStrategy
equals, hashCode, toString
-
Field Details
-
Rn_KIND
- See Also:
- Constant Field Values
-
-
Constructor Details
-
NameRecurrence
protected NameRecurrence()Used in contract testing. -
NameRecurrence
-
-
Method Details
-
canReferTo
public boolean canReferTo(I idFromDefiniteExpression, Referent<TB,S,I,QI> potentialReferent, S scope)Returns true, if the given definite expression is a simple name, the given potential referent has a name, and the simple name is equal to the name of the referent.- Parameters:
idFromDefiniteExpression- the ID created from the definite expression that shall referpotentialReferent- the potential referent of the definite expressionscope- the scope in which the definite expression occurs- Returns:
true, if the definite expression is a simple name that is equal to the (available) name of the referent,falseotherwise.- See Also:
isCaseSensitive(),canReferToUsingConceptualType(Object, Referent, Object)
-
canReferToUsingConceptualType
public boolean canReferToUsingConceptualType(I idFromDefiniteExpression, Referent<TB,S,I,QI> potentialReferent, S scope)Returns true, if the given definite expression is a simple name, the given potential referent has a name, and the conceptual type expressed in the simple name is equal to the conceptual type expressed in the name of the referent.Note that during case-sensitive matching the first character of the conceptual type expressed in the referent name is matched case-insensitively to the character at that position in the definite expression because camel case is used in the definite expression, if there is a prefix to the conceptual type in the definite expression.
- Parameters:
idFromDefiniteExpression- the ID from the definite expression that shall referpotentialReferent- the potential referent of the definite expressionscope- the scope in which the definite expression occurs- Returns:
true, if the definite expression is a simple name that is identical to the (available) name of the referent,falseotherwise.- See Also:
isCaseSensitive(),canReferTo(Object, Referent, Object)
-
getFeaturesRemainingInIdentifierIfItCanReferUsingConceptualType
public FeatureContainer<QI> getFeaturesRemainingInIdentifierIfItCanReferUsingConceptualType(I idFromDefiniteExpression, Referent<TB,S,I,QI> potentialReferent, S scope)Description copied from interface:ConceptReferentializationStrategyIfConceptReferentializationStrategy.canReferToUsingConceptualType(Object, Referent, Object)returnstruefor the given arguments, there is a suffix in the given definite expression that represents a conceptual type and can be used to refer to the given potential referent. In this case, this method returns aFeatureContainerwith all features that can be extracted from the remainder of the given definite expression after the suffix has been removed. If the remainder is empty, theFeatureContaineris empty, too.- Parameters:
idFromDefiniteExpression- The ID from the definite expression whose features are to be extracted.potentialReferent- The potential referent of the definite expression.scope- An optional scope object specific to the AST implementation.- Returns:
null, ifConceptReferentializationStrategy.canReferToUsingConceptualType(Object, Referent, Object)returns false, a (possibly) emptyFeatureContainerifConceptReferentializationStrategy.canReferToUsingConceptualType(Object, Referent, Object)returns true.- See Also:
FeatureReferentializationStrategy
-
isCaseSensitive
Whether to match case- Returns:
- false
-
getKind
Description copied from interface:StrategyReturns a short mnemonic string that uniquely identifies this strategy among the type of strategies it belongs to.- Returns:
- the kind of strategy
-