Class AbstractLocalTempVariableIntroducingStrategy<N,E,T,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.AbstractStrategy
de.monochromata.anaphors.ast.relatedexp.strategy.AbstractRelatedExpressionStrategy<N,E,T,B,MB,TB,S,I,QI,EV,PP,R>
de.monochromata.anaphors.ast.relatedexp.strategy.AbstractLocalTempVariableIntroducingStrategy<N,E,T,B,MB,TB,S,I,QI,EV,PP,R,A>
- Type Parameters:
N- The node type in the ASTE- The expression typeT- The type typeB- The binding typeMB- The method 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 perspectivationsR- The sub-type of related expression to useA- The sub-type of AST-based anaphora to use
- All Implemented Interfaces:
LocalTempVariableIntroducingStrategy<N,E,T,B,TB,S,I,QI,R,A>,RelatedExpressionStrategy<N,T,B,TB,S,QI,R>,Strategy
- Direct Known Subclasses:
ClassInstanceCreationStrategy,MethodInvocationStrategy
public abstract class AbstractLocalTempVariableIntroducingStrategy<N,E,T,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 AbstractRelatedExpressionStrategy<N,E,T,B,MB,TB,S,I,QI,EV,PP,R> implements LocalTempVariableIntroducingStrategy<N,E,T,B,TB,S,I,QI,R,A>
Abstract base class for related expressions whose realization introduces
local temporary variables.
-
Field Summary
Fields inherited from class de.monochromata.anaphors.ast.relatedexp.strategy.AbstractRelatedExpressionStrategy
preferences, relatedExpressionsSpi -
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractLocalTempVariableIntroducingStrategy()Used in contract testing.AbstractLocalTempVariableIntroducingStrategy(RelatedExpressionsSpi<N,E,T,B,MB,TB,S,I,QI,EV,PP,R> relatedExpressionsSpi, Preferences preferences) -
Method Summary
Modifier and Type Method Description IgetIdentifierForTempVariable(RelatedExpressionPart<N,E,T,B,TB,S,I,QI,R> relatedExpressionPart, List<AnaphorPart<N,E,T,B,TB,S,I,QI,R,A>> anaphorParts, S scope)intgetLengthOfTypeForTempVariable(RelatedExpressionPart<N,E,T,B,TB,S,I,QI,R> relatedExpressionPart, S scope)intgetLengthOfTypeForTempVariable(R relatedExpression, S scope)TgetTypeForTempVariable(RelatedExpressionPart<N,E,T,B,TB,S,I,QI,R> relatedExpressionPart, S scope, Function<TB,T> importRewrite)TgetTypeForTempVariable(R relatedExpression, S scope, Function<TB,T> importRewrite)List<Perspectivation>underspecifyRelatedExpression(R relatedExpression, List<org.apache.commons.lang3.tuple.Pair<LocalTempVariableContents,String>> variableContentsAndAnaphors, S scope)Create a perspectivations for the related expressionList<Perspectivation>underspecifyRelatedExpressionForLocalTempVariable(R relatedExpression, List<org.apache.commons.lang3.tuple.Pair<LocalTempVariableContents,String>> variableContentsAndAnaphors, S scope)protected booleanuseLocalVariableTypeInference(S scope)Methods inherited from class de.monochromata.anaphors.ast.relatedexp.strategy.AbstractRelatedExpressionStrategy
addToCollection, collectTo, stopCollectionMethods inherited from class de.monochromata.AbstractStrategy
equals, hashCode, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface de.monochromata.anaphors.ast.relatedexp.strategy.RelatedExpressionStrategy
collectTo, getKindOfRelatedExpressionToBeRealized, stopCollection
-
Constructor Details
-
AbstractLocalTempVariableIntroducingStrategy
protected AbstractLocalTempVariableIntroducingStrategy()Used in contract testing. -
AbstractLocalTempVariableIntroducingStrategy
public AbstractLocalTempVariableIntroducingStrategy(RelatedExpressionsSpi<N,E,T,B,MB,TB,S,I,QI,EV,PP,R> relatedExpressionsSpi, Preferences preferences)
-
-
Method Details
-
underspecifyRelatedExpression
public List<Perspectivation> underspecifyRelatedExpression(R relatedExpression, List<org.apache.commons.lang3.tuple.Pair<LocalTempVariableContents,String>> variableContentsAndAnaphors, S scope)Description copied from interface:RelatedExpressionStrategyCreate a perspectivations for the related expression -
underspecifyRelatedExpressionForLocalTempVariable
public List<Perspectivation> underspecifyRelatedExpressionForLocalTempVariable(R relatedExpression, List<org.apache.commons.lang3.tuple.Pair<LocalTempVariableContents,String>> variableContentsAndAnaphors, S scope) -
getLengthOfTypeForTempVariable
-
getLengthOfTypeForTempVariable
-
getTypeForTempVariable
-
getTypeForTempVariable
-
useLocalVariableTypeInference
-
getIdentifierForTempVariable
public I getIdentifierForTempVariable(RelatedExpressionPart<N,E,T,B,TB,S,I,QI,R> relatedExpressionPart, List<AnaphorPart<N,E,T,B,TB,S,I,QI,R,A>> anaphorParts, S scope)- Specified by:
getIdentifierForTempVariablein interfaceLocalTempVariableIntroducingStrategy<N,E,T,B,MB extends B,TB extends B,S,I,QI,EV>- Returns:
- The identifier to be used for the temp variable: for anaphora with
AnchoringStrategy, a name is derived from the related expression, for other anaphora, the anaphor is used.
-