diff options
author | Charles Lombardo <clombardo169@gmail.com> | 2023-03-11 06:35:40 +0100 |
---|---|---|
committer | bunnei <bunneidev@gmail.com> | 2023-06-03 09:05:40 +0200 |
commit | c02a27ebd2f5a93f87825fa44d1fe0e56e69634a (patch) | |
tree | 1ee849ac7a37fb2a20c654279ca617aeb59c8000 /src | |
parent | android: Convert AddDirectoryHelper to Kotlin (diff) | |
download | yuzu-c02a27ebd2f5a93f87825fa44d1fe0e56e69634a.tar yuzu-c02a27ebd2f5a93f87825fa44d1fe0e56e69634a.tar.gz yuzu-c02a27ebd2f5a93f87825fa44d1fe0e56e69634a.tar.bz2 yuzu-c02a27ebd2f5a93f87825fa44d1fe0e56e69634a.tar.lz yuzu-c02a27ebd2f5a93f87825fa44d1fe0e56e69634a.tar.xz yuzu-c02a27ebd2f5a93f87825fa44d1fe0e56e69634a.tar.zst yuzu-c02a27ebd2f5a93f87825fa44d1fe0e56e69634a.zip |
Diffstat (limited to 'src')
-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] + } +} |