diff options
Diffstat (limited to 'model-data/src/main/java/org/eclipse/viatra/solver/data/model/ModelCursor.java')
-rw-r--r-- | model-data/src/main/java/org/eclipse/viatra/solver/data/model/ModelCursor.java | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/model-data/src/main/java/org/eclipse/viatra/solver/data/model/ModelCursor.java b/model-data/src/main/java/org/eclipse/viatra/solver/data/model/ModelCursor.java deleted file mode 100644 index 3157c9f0..00000000 --- a/model-data/src/main/java/org/eclipse/viatra/solver/data/model/ModelCursor.java +++ /dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | package org.eclipse.viatra.solver.data.model; | ||
2 | |||
3 | import java.util.Map; | ||
4 | |||
5 | import org.eclipse.viatra.solver.data.map.Cursor; | ||
6 | import org.eclipse.viatra.solver.data.model.representation.DataRepresentation; | ||
7 | |||
8 | public class ModelCursor { | ||
9 | final Map<DataRepresentation<?, ?>,Cursor<?,?>> cursors; | ||
10 | |||
11 | public ModelCursor(Map<DataRepresentation<?, ?>, Cursor<?, ?>> cursors) { | ||
12 | super(); | ||
13 | this.cursors = cursors; | ||
14 | } | ||
15 | |||
16 | @SuppressWarnings("unchecked") | ||
17 | public <K,V> Cursor<K,V> getCursor(DataRepresentation<K, V> representation) { | ||
18 | Cursor<?, ?> cursor = cursors.get(representation); | ||
19 | if(cursor != null) { | ||
20 | return (Cursor<K, V>) cursor; | ||
21 | } else { | ||
22 | throw new IllegalArgumentException("ModelCursor does not contain cursor for representation "+representation); | ||
23 | } | ||
24 | } | ||
25 | } | ||