androidx.core.util
Interfaces
Consumer |
Compat version of |
Pool |
Interface for managing a pool of objects. |
Predicate |
Compat version of |
Supplier |
Compat version of |
Classes
AtomicFile |
Static library support version of the framework's |
ObjectsCompat |
This class consists of static utility methods for operating on objects. |
Pair |
Container to ease passing around a tuple of two objects. |
PatternsCompat |
Commonly used regular expression patterns. |
Pools |
Helper class for creating pools of objects. |
Top-level functions summary
LruCache<K, V> |
lruCache(maxSize: Int, crossinline sizeOf: (key: K, value: V) -> Int = { _, _ -> 1 }, crossinline create: (key: K) -> V? = { null as V? }, crossinline onEntryRemoved: (evicted: Boolean, key: K, oldValue: V, newValue: V?) -> Unit = { _, _, _, _ -> }) Creates an LruCache with the given parameters. |
infix Range<T> |
T.rangeTo(that: T) Creates a range from this Comparable value to that. |
Extension functions summary
For android.util.AtomicFile | |
ByteArray |
Gets the entire content of this file as a byte array. |
String |
AtomicFile.readText(charset: Charset = Charsets.UTF_8) Gets the entire content of this file as a String using UTF-8 or specified charset. |
Unit |
AtomicFile.tryWrite(block: (out: FileOutputStream) -> Unit) Perform the write operations inside block on this file. |
Unit |
AtomicFile.writeBytes(array: ByteArray) Sets the content of this file as an array of bytes. |
Unit |
AtomicFile.writeText(text: String, charset: Charset = Charsets.UTF_8) Sets the content of this file as text encoded using UTF-8 or specified charset. |
For android.util.LongSparseArray | |
operator Boolean |
LongSparseArray<T>.contains(key: Long) Returns true if the collection contains key. |
Boolean |
LongSparseArray<T>.containsKey(key: Long) Returns true if the collection contains key. |
Boolean |
LongSparseArray<T>.containsValue(value: T) Returns true if the collection contains value. |
Unit |
LongSparseArray<T>.forEach(action: (key: Long, value: T) -> Unit) Performs the given action for each key/value entry. |
T |
LongSparseArray<T>.getOrDefault(key: Long, defaultValue: T) Return the value corresponding to key, or defaultValue when not present. |
T |
LongSparseArray<T>.getOrElse(key: Long, defaultValue: () -> T) Return the value corresponding to key, or from defaultValue when not present. |
Boolean |
LongSparseArray<T>.isEmpty() Return true when the collection contains no elements. |
Boolean |
Return true when the collection contains elements. |