diff options
author | 2023-08-19 02:31:57 +0200 | |
---|---|---|
committer | 2023-08-19 02:31:57 +0200 | |
commit | 9adbb3d49899a87b3026c11cb4ba3ff77f4fb75b (patch) | |
tree | fad77963c1dc9028b0a767ac3ad69a174c8eb8c6 /subprojects/viatra-runtime-rete/src/main/java/tools/refinery/viatra/runtime/rete/network/communication/NodeComparator.java | |
parent | feat: predicate semantics (diff) | |
download | refinery-9adbb3d49899a87b3026c11cb4ba3ff77f4fb75b.tar.gz refinery-9adbb3d49899a87b3026c11cb4ba3ff77f4fb75b.tar.zst refinery-9adbb3d49899a87b3026c11cb4ba3ff77f4fb75b.zip |
chore: import VIATRA source
Make our modifications more maintainable by editing the source code directly
instead of using reflection.
Diffstat (limited to 'subprojects/viatra-runtime-rete/src/main/java/tools/refinery/viatra/runtime/rete/network/communication/NodeComparator.java')
-rw-r--r-- | subprojects/viatra-runtime-rete/src/main/java/tools/refinery/viatra/runtime/rete/network/communication/NodeComparator.java | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/subprojects/viatra-runtime-rete/src/main/java/tools/refinery/viatra/runtime/rete/network/communication/NodeComparator.java b/subprojects/viatra-runtime-rete/src/main/java/tools/refinery/viatra/runtime/rete/network/communication/NodeComparator.java new file mode 100644 index 00000000..27779352 --- /dev/null +++ b/subprojects/viatra-runtime-rete/src/main/java/tools/refinery/viatra/runtime/rete/network/communication/NodeComparator.java | |||
@@ -0,0 +1,32 @@ | |||
1 | /******************************************************************************* | ||
2 | * Copyright (c) 2010-2019, Tamas Szabo, Istvan Rath and Daniel Varro | ||
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 | *******************************************************************************/ | ||
9 | package tools.refinery.viatra.runtime.rete.network.communication; | ||
10 | |||
11 | import java.util.Comparator; | ||
12 | import java.util.Map; | ||
13 | |||
14 | import tools.refinery.viatra.runtime.rete.network.Node; | ||
15 | |||
16 | /** | ||
17 | * @since 2.4 | ||
18 | */ | ||
19 | public class NodeComparator implements Comparator<Node> { | ||
20 | |||
21 | protected final Map<Node, Integer> nodeMap; | ||
22 | |||
23 | public NodeComparator(final Map<Node, Integer> nodeMap) { | ||
24 | this.nodeMap = nodeMap; | ||
25 | } | ||
26 | |||
27 | @Override | ||
28 | public int compare(final Node left, final Node right) { | ||
29 | return this.nodeMap.get(left) - this.nodeMap.get(right); | ||
30 | } | ||
31 | |||
32 | } \ No newline at end of file | ||