Android Extensions: Add SparseArray implementation for the View cache (KT-18250)

This commit is contained in:
Yan Zhulanow
2017-06-05 23:32:56 +03:00
parent fbfd51e97e
commit 7b238e0b21
9 changed files with 221 additions and 41 deletions
@@ -0,0 +1,19 @@
package android.util
class SparseArray<E : Any> {
private val map = HashMap<Int, E>()
fun get(key: Int): E? {
return map.get(key)
}
fun put(key: Int, value: E) {
map.put(key, value)
}
fun remove(key: Int): E? {
return map.remove(key)
}
fun clear() {}
}