Class Hyponymy<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.Hyponymy<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
public class Hyponymy<N,E,TB,S,I,QI,EV,PP> extends AbstractConceptReferentializationStrategy<N,E,TB,S,I,QI,EV,PP>
Referentialization based on case-insensitive hyponymy (i.e. matching
referents whose type is a - potentially transitive - super-class or a -
potentially transitively - implemented interface of the type of the definite
expression).
-
Field Summary
Fields inherited from class de.monochromata.anaphors.ast.reference.strategy.AbstractReferentializationStrategy
anaphorsSpi -
Constructor Summary
Constructors Modifier Constructor Description protectedHyponymy()Used in contract testing.Hyponymy(AnaphorsSpi<N,E,TB,S,I,QI,EV,PP> anaphorsSpi, Function<TB,Optional<TB>> getSuperClass, Function<TB,List<TB>> getImplementedInterfaces)Hyponymy(Function<TB,Optional<TB>> getSuperClass, Function<TB,List<TB>> getImplementedInterfaces, Function<I,Function<TB,Boolean>> nameOfIdentifierEqualsSimpleNameOfTypeBinding, Function<I,Function<TB,Boolean>> conceptualTypeInIdentifierEqualsSimpleNameOfTypeBinding) -
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.booleancanReferToUsingConceptualType(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.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.Methods inherited from class de.monochromata.AbstractStrategy
equals, hashCode, toString
-
Field Details
-
Hy_KIND
- See Also:
- Constant Field Values
-
-
Constructor Details
-
Hyponymy
protected Hyponymy()Used in contract testing. -
Hyponymy
-
Hyponymy
-
-
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.- 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.
-
canReferToUsingConceptualType
public boolean canReferToUsingConceptualType(I idFromDefiniteExpression, Referent<TB,S,I,QI> potentialReferent, S scope)Description copied from interface:ConceptReferentializationStrategyChecks whether the given definite expression can, using this referentialization strategy, refer to the given potential referent in the given scope. UnlikeReferentializationStrategy.canReferTo(Object, Referent, Object), this method requires only conceptual-type information in a suffix of the definite expression to be matched by the information of the given potential referent for the method to return true. Matching is performed in a way that is specific to the referentialization strategy.- 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 the conceptual-type information provided by a suffix of the definite expression matches the information provided by the potential referent, where matching depends on the implementation of this method,falseotherwise.
-
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
-
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
-