diff options
Diffstat (limited to 'model-data/src/main/java/org/eclipse/viatra/solver/data/map/internal/VersionedMapImpl.java')
-rw-r--r-- | model-data/src/main/java/org/eclipse/viatra/solver/data/map/internal/VersionedMapImpl.java | 13 |
1 files changed, 6 insertions, 7 deletions
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 d04e7117..25473fd8 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 | |||
@@ -20,13 +20,13 @@ import org.eclipse.viatra.solver.data.map.VersionedMapStoreImpl; | |||
20 | public class VersionedMapImpl<K,V> implements VersionedMap<K,V>{ | 20 | public class VersionedMapImpl<K,V> implements VersionedMap<K,V>{ |
21 | protected final VersionedMapStoreImpl<K,V> store; | 21 | protected final VersionedMapStoreImpl<K,V> store; |
22 | 22 | ||
23 | protected final ContinousHashProvider<? super K> hashProvider; | 23 | protected final ContinousHashProvider<K> hashProvider; |
24 | protected final V defaultValue; | 24 | protected final V defaultValue; |
25 | protected Node<K,V> root; | 25 | protected Node<K,V> root; |
26 | 26 | ||
27 | public VersionedMapImpl( | 27 | public VersionedMapImpl( |
28 | VersionedMapStoreImpl<K,V> store, | 28 | VersionedMapStoreImpl<K,V> store, |
29 | ContinousHashProvider<? super K> hashProvider, | 29 | ContinousHashProvider<K> hashProvider, |
30 | V defaultValue) | 30 | V defaultValue) |
31 | { | 31 | { |
32 | this.store = store; | 32 | this.store = store; |
@@ -36,7 +36,7 @@ public class VersionedMapImpl<K,V> implements VersionedMap<K,V>{ | |||
36 | } | 36 | } |
37 | public VersionedMapImpl( | 37 | public VersionedMapImpl( |
38 | VersionedMapStoreImpl<K,V> store, | 38 | VersionedMapStoreImpl<K,V> store, |
39 | ContinousHashProvider<? super K> hashProvider, | 39 | ContinousHashProvider<K> hashProvider, |
40 | V defaultValue, Node<K,V> data) | 40 | V defaultValue, Node<K,V> data) |
41 | { | 41 | { |
42 | this.store = store; | 42 | this.store = store; |
@@ -48,7 +48,7 @@ public class VersionedMapImpl<K,V> implements VersionedMap<K,V>{ | |||
48 | public V getDefaultValue() { | 48 | public V getDefaultValue() { |
49 | return defaultValue; | 49 | return defaultValue; |
50 | } | 50 | } |
51 | public ContinousHashProvider<? super K> getHashProvider() { | 51 | public ContinousHashProvider<K> getHashProvider() { |
52 | return hashProvider; | 52 | return hashProvider; |
53 | } | 53 | } |
54 | @Override | 54 | @Override |
@@ -100,15 +100,14 @@ public class VersionedMapImpl<K,V> implements VersionedMap<K,V>{ | |||
100 | 100 | ||
101 | @Override | 101 | @Override |
102 | public Cursor<K, V> getCursor() { | 102 | public Cursor<K, V> getCursor() { |
103 | MapCursor<K,V> cursor = new MapCursor<>(this.root,this); | 103 | return new MapCursor<>(this.root,this); |
104 | return cursor; | ||
105 | } | 104 | } |
106 | @Override | 105 | @Override |
107 | public DiffCursor<K, V> getDiffCursor(long toVersion) { | 106 | public DiffCursor<K, V> getDiffCursor(long toVersion) { |
108 | Cursor<K, V> fromCursor = this.getCursor(); | 107 | Cursor<K, V> fromCursor = this.getCursor(); |
109 | VersionedMap<K, V> toMap = this.store.createMap(toVersion); | 108 | VersionedMap<K, V> toMap = this.store.createMap(toVersion); |
110 | Cursor<K, V> toCursor = toMap.getCursor(); | 109 | Cursor<K, V> toCursor = toMap.getCursor(); |
111 | return new MapDiffCursor<K, V>(this.hashProvider,this.defaultValue, fromCursor, toCursor); | 110 | return new MapDiffCursor<>(this.hashProvider,this.defaultValue, fromCursor, toCursor); |
112 | 111 | ||
113 | } | 112 | } |
114 | 113 | ||