Class IterateOverChildren
- java.lang.Object
-
- org.eclipse.viatra.query.runtime.localsearch.operations.extend.IterateOverChildren
-
- All Implemented Interfaces:
ISearchOperation
public class IterateOverChildren extends java.lang.Object implements ISearchOperation
Iterates all child elements of a selected EObjects.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.eclipse.viatra.query.runtime.localsearch.operations.ISearchOperation
ISearchOperation.ISearchOperationExecutor
-
-
Constructor Summary
Constructors Constructor Description IterateOverChildren(int position, int sourcePosition, boolean transitive)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ISearchOperation.ISearchOperationExecutorcreateExecutor()Initializes a new operation executor for the given operation.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
-
IterateOverChildren
public IterateOverChildren(int position, int sourcePosition, boolean transitive)- Parameters:
position- the position of the variable storing the child elementssourcePosition- the position of the variable storing the parent root; must be boundtransitive- if true, child elements are iterated over transitively
-
-
Method Detail
-
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
-
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
-
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
-
-