aboutsummaryrefslogtreecommitdiffstats
path: root/subprojects/viatra-runtime-localsearch/src/main/java/tools/refinery/viatra/runtime/localsearch/operations/extend/SingleValueExtendOperationExecutor.java
diff options
context:
space:
mode:
Diffstat (limited to 'subprojects/viatra-runtime-localsearch/src/main/java/tools/refinery/viatra/runtime/localsearch/operations/extend/SingleValueExtendOperationExecutor.java')
-rw-r--r--subprojects/viatra-runtime-localsearch/src/main/java/tools/refinery/viatra/runtime/localsearch/operations/extend/SingleValueExtendOperationExecutor.java40
1 files changed, 40 insertions, 0 deletions
diff --git a/subprojects/viatra-runtime-localsearch/src/main/java/tools/refinery/viatra/runtime/localsearch/operations/extend/SingleValueExtendOperationExecutor.java b/subprojects/viatra-runtime-localsearch/src/main/java/tools/refinery/viatra/runtime/localsearch/operations/extend/SingleValueExtendOperationExecutor.java
new file mode 100644
index 00000000..a04ffcca
--- /dev/null
+++ b/subprojects/viatra-runtime-localsearch/src/main/java/tools/refinery/viatra/runtime/localsearch/operations/extend/SingleValueExtendOperationExecutor.java
@@ -0,0 +1,40 @@
1/*******************************************************************************
2 * Copyright (c) 2010-2018, Zoltan Ujhelyi, IncQuery Labs Ltd.
3 * This program and the accompanying materials are made available under the
4 * terms of the Eclipse Public License v. 2.0 which is available at
5 * http://www.eclipse.org/legal/epl-v20.html.
6 *
7 * SPDX-License-Identifier: EPL-2.0
8 *******************************************************************************/
9package tools.refinery.viatra.runtime.localsearch.operations.extend;
10
11import tools.refinery.viatra.runtime.localsearch.MatchingFrame;
12import tools.refinery.viatra.runtime.localsearch.matcher.ISearchContext;
13import tools.refinery.viatra.runtime.localsearch.operations.ExtendOperationExecutor;
14
15/**
16 * @since 2.0
17 * @noextend This class is not intended to be subclassed by clients.
18 */
19public abstract class SingleValueExtendOperationExecutor<T> extends ExtendOperationExecutor<T> {
20 protected int position;
21
22 /**
23 * @param position the frame position all values are to be added
24 */
25 public SingleValueExtendOperationExecutor(int position) {
26 super();
27 this.position = position;
28 }
29
30 @Override
31 protected final boolean fillInValue(T newValue, MatchingFrame frame, ISearchContext context) {
32 frame.setValue(position, newValue);
33 return true;
34 }
35
36 @Override
37 protected final void cleanup(MatchingFrame frame, ISearchContext context) {
38 frame.setValue(position, null);
39 }
40} \ No newline at end of file