Class ExtendBinaryTransitiveClosure
- java.lang.Object
-
- org.eclipse.viatra.query.runtime.localsearch.operations.extend.ExtendBinaryTransitiveClosure
-
- All Implemented Interfaces:
IPatternMatcherOperation,ISearchOperation
- Direct Known Subclasses:
ExtendBinaryTransitiveClosure.Backward,ExtendBinaryTransitiveClosure.Forward
public abstract class ExtendBinaryTransitiveClosure extends java.lang.Object implements ISearchOperation, IPatternMatcherOperation
Checking for a transitive closure expressed as a local search pattern matcher. The matched pattern must have two parameters of the same model type.- Since:
- 1.7
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classExtendBinaryTransitiveClosure.BackwardCalculates the transitive closure of a pattern match in a backward direction (first parameter unbound, second bound)static classExtendBinaryTransitiveClosure.ForwardCalculates the transitive closure of a pattern match in a forward direction (first parameter bound, second unbound).-
Nested classes/interfaces inherited from interface org.eclipse.viatra.query.runtime.localsearch.operations.ISearchOperation
ISearchOperation.ISearchOperationExecutor
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedExtendBinaryTransitiveClosure(CallInformation information, int seedPosition, int targetPosition, boolean reflexive)The source position will be matched in the called pattern to the first parameter; while target to the second.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract java.lang.Object[]calculateCallFrame(java.lang.Object seed)ISearchOperation.ISearchOperationExecutorcreateExecutor()Initializes a new operation executor for the given operation.CallInformationgetCallInformation()Returns the precomputed call information associated with the current operationprotected abstract java.lang.ObjectgetTarget(Tuple frame)java.util.List<java.lang.Integer>getVariablePositions()java.lang.StringtoString()java.lang.StringtoString(java.util.function.Function<java.lang.Integer,java.lang.String> variableMapping)Creates a string representation of the search operation by replacing the variable numbers according to the parameter function.
-
-
-
Constructor Detail
-
ExtendBinaryTransitiveClosure
protected ExtendBinaryTransitiveClosure(CallInformation information, int seedPosition, int targetPosition, boolean reflexive)
The source position will be matched in the called pattern to the first parameter; while target to the second.- Since:
- 2.0
-
-
Method Detail
-
calculateCallFrame
protected abstract java.lang.Object[] calculateCallFrame(java.lang.Object seed)
-
getTarget
protected abstract java.lang.Object getTarget(Tuple frame)
-
createExecutor
public ISearchOperation.ISearchOperationExecutor createExecutor()
Description copied from interface:ISearchOperationInitializes a new operation executor for the given operation. Repeated calls must return different executor instances.- Specified by:
createExecutorin interfaceISearchOperation
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toString
public java.lang.String toString(java.util.function.Function<java.lang.Integer,java.lang.String> variableMapping)
Description copied from interface:ISearchOperationCreates a string representation of the search operation by replacing the variable numbers according to the parameter function. It is expected that the provided function does return a non-null value for each variable index that is returned byISearchOperation.getVariablePositions(); otherwise aNullPointerExceptionwill be thrown during the calculation of the string.- Specified by:
toStringin interfaceISearchOperation
-
getVariablePositions
public java.util.List<java.lang.Integer> getVariablePositions()
- Specified by:
getVariablePositionsin interfaceISearchOperation- Returns:
- the ordered list of the variable numbers that are affected by the search operation
-
getCallInformation
public CallInformation getCallInformation()
Description copied from interface:IPatternMatcherOperationReturns the precomputed call information associated with the current operation- Specified by:
getCallInformationin interfaceIPatternMatcherOperation
-
-