diff options
-rw-r--r-- | src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/BiMap.java | 22 | ||||
-rw-r--r-- | src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/BiMap.kt | 22 |
2 files changed, 22 insertions, 22 deletions
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/BiMap.java b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/BiMap.java deleted file mode 100644 index eaf25fa43..000000000 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/BiMap.java +++ /dev/null @@ -1,22 +0,0 @@ -package org.yuzu.yuzu_emu.utils; - -import java.util.HashMap; -import java.util.Map; - -public class BiMap<K, V> { - private Map<K, V> forward = new HashMap<K, V>(); - private Map<V, K> backward = new HashMap<V, K>(); - - public synchronized void add(K key, V value) { - forward.put(key, value); - backward.put(value, key); - } - - public synchronized V getForward(K key) { - return forward.get(key); - } - - public synchronized K getBackward(V key) { - return backward.get(key); - } -} diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/BiMap.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/BiMap.kt new file mode 100644 index 000000000..9f11454bc --- /dev/null +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/utils/BiMap.kt @@ -0,0 +1,22 @@ +package org.yuzu.yuzu_emu.utils + +class BiMap<K, V> { + private val forward: MutableMap<K, V> = HashMap() + private val backward: MutableMap<V, K> = HashMap() + + @Synchronized + fun add(key: K, value: V) { + forward[key] = value + backward[value] = key + } + + @Synchronized + fun getForward(key: K): V? { + return forward[key] + } + + @Synchronized + fun getBackward(key: V): K? { + return backward[key] + } +} |