diff options
Diffstat (limited to 'Solvers/VIATRA-Solver/org.eclipse.viatra.dse/src/org/eclipse/viatra/dse/statecoding/StatecodingDependencyGraph.java')
-rw-r--r-- | Solvers/VIATRA-Solver/org.eclipse.viatra.dse/src/org/eclipse/viatra/dse/statecoding/StatecodingDependencyGraph.java | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/Solvers/VIATRA-Solver/org.eclipse.viatra.dse/src/org/eclipse/viatra/dse/statecoding/StatecodingDependencyGraph.java b/Solvers/VIATRA-Solver/org.eclipse.viatra.dse/src/org/eclipse/viatra/dse/statecoding/StatecodingDependencyGraph.java new file mode 100644 index 00000000..6f7255a3 --- /dev/null +++ b/Solvers/VIATRA-Solver/org.eclipse.viatra.dse/src/org/eclipse/viatra/dse/statecoding/StatecodingDependencyGraph.java | |||
@@ -0,0 +1,44 @@ | |||
1 | /******************************************************************************* | ||
2 | * Copyright (c) 2010-2015, Andras Szabolcs Nagy 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 org.eclipse.viatra.dse.statecoding; | ||
10 | |||
11 | import java.util.ArrayList; | ||
12 | import java.util.List; | ||
13 | |||
14 | import org.eclipse.emf.ecore.EClass; | ||
15 | |||
16 | public class StatecodingDependencyGraph { | ||
17 | |||
18 | private List<StatecodingNode> nodes = new ArrayList<StatecodingNode>(); | ||
19 | |||
20 | public StatecodingNode createNode(EClass clazz) { | ||
21 | StatecodingNode node = new StatecodingNode(clazz); | ||
22 | node.setGraph(this); | ||
23 | addNode(node); | ||
24 | return node; | ||
25 | } | ||
26 | |||
27 | public void addNode(StatecodingNode node) { | ||
28 | nodes.add(node); | ||
29 | } | ||
30 | |||
31 | public StatecodingNode getNodeByClass(EClass eClass) { | ||
32 | for (StatecodingNode node : nodes) { | ||
33 | if (node.getClazz().equals(eClass)) { | ||
34 | return node; | ||
35 | } | ||
36 | } | ||
37 | return null; | ||
38 | } | ||
39 | |||
40 | public List<StatecodingNode> getNodes() { | ||
41 | return nodes; | ||
42 | } | ||
43 | |||
44 | } | ||