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. |
LongIterator |
Return an iterator over the collection's keys. |
operator LongSparseArray<T> |
LongSparseArray<T>.plus(other: LongSparseArray<T>) Creates a new collection by adding or replacing entries from other. |
Unit |
LongSparseArray<T>.putAll(other: LongSparseArray<T>) Update this collection by adding or replacing entries from other. |
Boolean |
LongSparseArray<T>.remove(key: Long, value: T) |
operator Unit |
LongSparseArray<T>.set(key: Long, value: T) Allows the use of the index operator for storing values in the collection. |
Iterator<T> |
Return an iterator over the collection's values. |
For android.util.Pair | |
operator F |
Pair<F, S>.component1() Returns the first component of the pair. |
operator S |
Pair<F, S>.component2() Returns the second component of the pair. |
Pair<F, S> |
Pair<F, S>.toKotlinPair() Returns this Android |
For android.util.Range | |
infix Range<T> |
Return the intersection of this range and other. |
operator Range<T> |
Return the smallest range that includes this and value. |
operator Range<T> |
Return the smallest range that includes this and other. |
ClosedRange<T> |
Range<T>.toClosedRange() Returns this Range as a ClosedRange. |
For android.util.Size | |
operator Int |
Returns "width", the first component of this Size. |
operator Int |
Returns "height", the second component of this Size. |
For android.util.SizeF | |
operator Float |
Returns "width", the first component of this SizeF. |
operator Float |
Returns "height", the second component of this SizeF. |
For android.util.SparseArray | |
operator Boolean |
SparseArray<T>.contains(key: Int) Returns true if the collection contains key. |