diff options
author | OszkarSemerath <semerath@mit.bme.hu> | 2021-08-10 19:18:36 +0200 |
---|---|---|
committer | OszkarSemerath <semerath@mit.bme.hu> | 2021-08-10 19:18:36 +0200 |
commit | daceb22ba196de524928e37a7a9af9cd79ffed63 (patch) | |
tree | 377d94aebc1954d1d9d4d73c120986913d7db428 /model-data/src/main/java/org/eclipse/viatra | |
parent | Model and model store interfaces and implementations (diff) | |
download | refinery-daceb22ba196de524928e37a7a9af9cd79ffed63.tar.gz refinery-daceb22ba196de524928e37a7a9af9cd79ffed63.tar.zst refinery-daceb22ba196de524928e37a7a9af9cd79ffed63.zip |
getCursor renamed to getAll
Diffstat (limited to 'model-data/src/main/java/org/eclipse/viatra')
4 files changed, 12 insertions, 10 deletions
diff --git a/model-data/src/main/java/org/eclipse/viatra/solver/data/map/VersionedMap.java b/model-data/src/main/java/org/eclipse/viatra/solver/data/map/VersionedMap.java index fb42d822..2f2cb7a2 100644 --- a/model-data/src/main/java/org/eclipse/viatra/solver/data/map/VersionedMap.java +++ b/model-data/src/main/java/org/eclipse/viatra/solver/data/map/VersionedMap.java | |||
@@ -1,11 +1,13 @@ | |||
1 | package org.eclipse.viatra.solver.data.map; | 1 | package org.eclipse.viatra.solver.data.map; |
2 | 2 | ||
3 | public interface VersionedMap<K,V> extends Versioned{ | 3 | public interface VersionedMap<K,V> extends Versioned{ |
4 | public void put(K key, V value); | ||
5 | public V get(K key); | 4 | public V get(K key); |
5 | public Cursor<K,V> getAll(); | ||
6 | |||
7 | public void put(K key, V value); | ||
8 | public void putAll(Cursor<K,V> cursor); | ||
9 | |||
6 | public long getSize(); | 10 | public long getSize(); |
7 | 11 | ||
8 | public Cursor<K,V> getCursor(); | ||
9 | public DiffCursor<K,V> getDiffCursor(long state); | 12 | public DiffCursor<K,V> getDiffCursor(long state); |
10 | public void putAll(Cursor<K,V> cursor); | ||
11 | } | 13 | } |
diff --git a/model-data/src/main/java/org/eclipse/viatra/solver/data/map/VersionedMapStoreImpl.java b/model-data/src/main/java/org/eclipse/viatra/solver/data/map/VersionedMapStoreImpl.java index 9ee4cfdf..4f3d8b10 100644 --- a/model-data/src/main/java/org/eclipse/viatra/solver/data/map/VersionedMapStoreImpl.java +++ b/model-data/src/main/java/org/eclipse/viatra/solver/data/map/VersionedMapStoreImpl.java | |||
@@ -127,8 +127,8 @@ public class VersionedMapStoreImpl<K, V> implements VersionedMapStore<K, V> { | |||
127 | public DiffCursor<K, V> getDiffCursor(long fromState, long toState) { | 127 | public DiffCursor<K, V> getDiffCursor(long fromState, long toState) { |
128 | VersionedMap<K, V> map1 = createMap(fromState); | 128 | VersionedMap<K, V> map1 = createMap(fromState); |
129 | VersionedMap<K, V> map2 = createMap(toState); | 129 | VersionedMap<K, V> map2 = createMap(toState); |
130 | Cursor<K, V> cursor1 = map1.getCursor(); | 130 | Cursor<K, V> cursor1 = map1.getAll(); |
131 | Cursor<K, V> cursor2 = map2.getCursor(); | 131 | Cursor<K, V> cursor2 = map2.getAll(); |
132 | return new MapDiffCursor<>(this.hashProvider, this.defaultValue, cursor1, cursor2); | 132 | return new MapDiffCursor<>(this.hashProvider, this.defaultValue, cursor1, cursor2); |
133 | } | 133 | } |
134 | } | 134 | } |
diff --git a/model-data/src/main/java/org/eclipse/viatra/solver/data/map/internal/VersionedMapImpl.java b/model-data/src/main/java/org/eclipse/viatra/solver/data/map/internal/VersionedMapImpl.java index 25473fd8..ef962f13 100644 --- a/model-data/src/main/java/org/eclipse/viatra/solver/data/map/internal/VersionedMapImpl.java +++ b/model-data/src/main/java/org/eclipse/viatra/solver/data/map/internal/VersionedMapImpl.java | |||
@@ -99,14 +99,14 @@ public class VersionedMapImpl<K,V> implements VersionedMap<K,V>{ | |||
99 | } | 99 | } |
100 | 100 | ||
101 | @Override | 101 | @Override |
102 | public Cursor<K, V> getCursor() { | 102 | public Cursor<K, V> getAll() { |
103 | return new MapCursor<>(this.root,this); | 103 | return new MapCursor<>(this.root,this); |
104 | } | 104 | } |
105 | @Override | 105 | @Override |
106 | public DiffCursor<K, V> getDiffCursor(long toVersion) { | 106 | public DiffCursor<K, V> getDiffCursor(long toVersion) { |
107 | Cursor<K, V> fromCursor = this.getCursor(); | 107 | Cursor<K, V> fromCursor = this.getAll(); |
108 | VersionedMap<K, V> toMap = this.store.createMap(toVersion); | 108 | VersionedMap<K, V> toMap = this.store.createMap(toVersion); |
109 | Cursor<K, V> toCursor = toMap.getCursor(); | 109 | Cursor<K, V> toCursor = toMap.getAll(); |
110 | return new MapDiffCursor<>(this.hashProvider,this.defaultValue, fromCursor, toCursor); | 110 | return new MapDiffCursor<>(this.hashProvider,this.defaultValue, fromCursor, toCursor); |
111 | 111 | ||
112 | } | 112 | } |
diff --git a/model-data/src/main/java/org/eclipse/viatra/solver/data/model/internal/ModelImpl.java b/model-data/src/main/java/org/eclipse/viatra/solver/data/model/internal/ModelImpl.java index 49699933..55ddfd3a 100644 --- a/model-data/src/main/java/org/eclipse/viatra/solver/data/model/internal/ModelImpl.java +++ b/model-data/src/main/java/org/eclipse/viatra/solver/data/model/internal/ModelImpl.java | |||
@@ -53,7 +53,7 @@ public class ModelImpl implements Model { | |||
53 | 53 | ||
54 | @Override | 54 | @Override |
55 | public <K, V> Cursor<K, V> getAll(DataRepresentation<K, V> representation) { | 55 | public <K, V> Cursor<K, V> getAll(DataRepresentation<K, V> representation) { |
56 | return getMap(representation).getCursor(); | 56 | return getMap(representation).getAll(); |
57 | } | 57 | } |
58 | 58 | ||
59 | @Override | 59 | @Override |
@@ -84,7 +84,7 @@ public class ModelImpl implements Model { | |||
84 | 84 | ||
85 | private <K, V> MapDiffCursor<K, V> constructDiffCursor(Model toModel, DataRepresentation<K, V> representation) { | 85 | private <K, V> MapDiffCursor<K, V> constructDiffCursor(Model toModel, DataRepresentation<K, V> representation) { |
86 | @SuppressWarnings("unchecked") | 86 | @SuppressWarnings("unchecked") |
87 | Cursor<K, V> fromCursor = (Cursor<K, V>) this.maps.get(representation).getCursor(); | 87 | Cursor<K, V> fromCursor = (Cursor<K, V>) this.maps.get(representation).getAll(); |
88 | Cursor<K, V> toCursor = toModel.getAll(representation); | 88 | Cursor<K, V> toCursor = toModel.getAll(representation); |
89 | 89 | ||
90 | ContinousHashProvider<K> hashProvider = representation.getHashProvider(); | 90 | ContinousHashProvider<K> hashProvider = representation.getHashProvider(); |