diff options
Diffstat (limited to 'model-data/src/main/java/org/eclipse/viatra/solver/data/query/internal/RelationViewKey.java')
-rw-r--r-- | model-data/src/main/java/org/eclipse/viatra/solver/data/query/internal/RelationViewKey.java | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/model-data/src/main/java/org/eclipse/viatra/solver/data/query/internal/RelationViewKey.java b/model-data/src/main/java/org/eclipse/viatra/solver/data/query/internal/RelationViewKey.java deleted file mode 100644 index bae0af45..00000000 --- a/model-data/src/main/java/org/eclipse/viatra/solver/data/query/internal/RelationViewKey.java +++ /dev/null | |||
@@ -1,60 +0,0 @@ | |||
1 | package org.eclipse.viatra.solver.data.query.internal; | ||
2 | |||
3 | import java.util.Objects; | ||
4 | import java.util.UUID; | ||
5 | |||
6 | import org.eclipse.viatra.query.runtime.matchers.context.common.BaseInputKeyWrapper; | ||
7 | import org.eclipse.viatra.solver.data.query.view.RelationView; | ||
8 | |||
9 | public class RelationViewKey<D> extends BaseInputKeyWrapper<RelationView<D>>{ | ||
10 | private final String uniqueName; | ||
11 | private final int arity; | ||
12 | |||
13 | public RelationViewKey(RelationView<D> wrappedKey, int arity) { | ||
14 | super(wrappedKey); | ||
15 | this.uniqueName = wrappedKey.getRepresentation().getName() + "-"+UUID.randomUUID(); | ||
16 | this.arity = arity; | ||
17 | } | ||
18 | |||
19 | @Override | ||
20 | public String getPrettyPrintableName() { | ||
21 | return wrappedKey.getRepresentation().getName(); | ||
22 | } | ||
23 | |||
24 | @Override | ||
25 | public String getStringID() { | ||
26 | return uniqueName; | ||
27 | } | ||
28 | |||
29 | @Override | ||
30 | public int getArity() { | ||
31 | return arity; | ||
32 | } | ||
33 | |||
34 | @Override | ||
35 | public boolean isEnumerable() { | ||
36 | return true; | ||
37 | } | ||
38 | |||
39 | @Override | ||
40 | public int hashCode() { | ||
41 | final int prime = 31; | ||
42 | int result = super.hashCode(); | ||
43 | result = prime * result + Objects.hash(uniqueName); | ||
44 | return result; | ||
45 | } | ||
46 | |||
47 | @Override | ||
48 | public boolean equals(Object obj) { | ||
49 | if (this == obj) | ||
50 | return true; | ||
51 | if (!super.equals(obj)) | ||
52 | return false; | ||
53 | if (!(obj instanceof RelationViewKey)) | ||
54 | return false; | ||
55 | RelationViewKey<?> other = (RelationViewKey<?>) obj; | ||
56 | return Objects.equals(uniqueName, other.uniqueName); | ||
57 | } | ||
58 | |||
59 | |||
60 | } | ||