diff options
author | 2021-08-10 19:16:37 +0200 | |
---|---|---|
committer | 2021-08-10 19:16:37 +0200 | |
commit | 1fa02964a83179df89d28f2de2ac706925d166ab (patch) | |
tree | ac844bd39f3828d73e35a32dbde4ee4c61508a8d /model-data | |
parent | Representations (diff) | |
download | refinery-1fa02964a83179df89d28f2de2ac706925d166ab.tar.gz refinery-1fa02964a83179df89d28f2de2ac706925d166ab.tar.zst refinery-1fa02964a83179df89d28f2de2ac706925d166ab.zip |
Key validation
Diffstat (limited to 'model-data')
3 files changed, 11 insertions, 0 deletions
diff --git a/model-data/src/main/java/org/eclipse/viatra/solver/data/model/representation/AuxilaryDataRepresentation.java b/model-data/src/main/java/org/eclipse/viatra/solver/data/model/representation/AuxilaryDataRepresentation.java index c524ba37..15116afd 100644 --- a/model-data/src/main/java/org/eclipse/viatra/solver/data/model/representation/AuxilaryDataRepresentation.java +++ b/model-data/src/main/java/org/eclipse/viatra/solver/data/model/representation/AuxilaryDataRepresentation.java | |||
@@ -8,4 +8,9 @@ public class AuxilaryDataRepresentation<K,V> extends DataRepresentation<K, V> { | |||
8 | V defaultValue) { | 8 | V defaultValue) { |
9 | super(keyClass, hashProvider, valueClass, defaultValue); | 9 | super(keyClass, hashProvider, valueClass, defaultValue); |
10 | } | 10 | } |
11 | |||
12 | @Override | ||
13 | public boolean isValidKey(K key) { | ||
14 | return true; | ||
15 | } | ||
11 | } | 16 | } |
diff --git a/model-data/src/main/java/org/eclipse/viatra/solver/data/model/representation/DataRepresentation.java b/model-data/src/main/java/org/eclipse/viatra/solver/data/model/representation/DataRepresentation.java index 41205c83..e04606f5 100644 --- a/model-data/src/main/java/org/eclipse/viatra/solver/data/model/representation/DataRepresentation.java +++ b/model-data/src/main/java/org/eclipse/viatra/solver/data/model/representation/DataRepresentation.java | |||
@@ -27,6 +27,7 @@ abstract public class DataRepresentation<K, V> { | |||
27 | public ContinousHashProvider<K> getHashProvider() { | 27 | public ContinousHashProvider<K> getHashProvider() { |
28 | return hashProvider; | 28 | return hashProvider; |
29 | } | 29 | } |
30 | public abstract boolean isValidKey(K key); | ||
30 | 31 | ||
31 | public V getDefaultValue() { | 32 | public V getDefaultValue() { |
32 | return defaultValue; | 33 | return defaultValue; |
diff --git a/model-data/src/main/java/org/eclipse/viatra/solver/data/model/representation/SymbolRepresentation.java b/model-data/src/main/java/org/eclipse/viatra/solver/data/model/representation/SymbolRepresentation.java index 442f9dc6..c8b7473f 100644 --- a/model-data/src/main/java/org/eclipse/viatra/solver/data/model/representation/SymbolRepresentation.java +++ b/model-data/src/main/java/org/eclipse/viatra/solver/data/model/representation/SymbolRepresentation.java | |||
@@ -15,4 +15,9 @@ public class SymbolRepresentation <D> extends DataRepresentation<Tuple,D> { | |||
15 | public Symbol getSymbol() { | 15 | public Symbol getSymbol() { |
16 | return symbol; | 16 | return symbol; |
17 | } | 17 | } |
18 | |||
19 | @Override | ||
20 | public boolean isValidKey(Tuple key) { | ||
21 | return key.getSize() == symbol.getArity(); | ||
22 | } | ||
18 | } | 23 | } |