IntPool

object IntPool : ObjectPool<Int>

Int Pool

The int pool stores commonly used Int that must be created throughout the project and take a long time to build.

Example:

IntPool["key"] = 0

Since

1.4.0

See also

Properties

Link copied to clipboard
var objects: HashMap<String, Int>
Link copied to clipboard
val size: Int

Pool size

Functions

Link copied to clipboard
fun first(): Int

Returns the first value or throws an exception if pool is empty.

Link copied to clipboard
inline fun firstOrElse(defaultValue: () -> Int): Int

Returns the first value, or the result of the defaultValue function if there was no entry.

Link copied to clipboard
fun firstOrNull(): Int?

Returns the first value, or null if this pool contains no entry.

Link copied to clipboard
operator fun get(key: String): Int

Returns the value for the given key or throws an exception if there is no such key in the pool.

Link copied to clipboard
inline fun getOrElse(key: String, defaultValue: () -> Int): Int

Returns the value for the given key, or the result of the defaultValue function if there was no entry for the given key.

Link copied to clipboard
fun getOrNull(key: String): Int?

Returns the value to which the specified key is mapped, or null if this pool contains no mapping for the key.

Link copied to clipboard
fun last(): Int

Returns the last value or throws an exception if pool is empty.

Link copied to clipboard
inline fun lastOrElse(defaultValue: () -> Int): Int

Returns the last value, or the result of the defaultValue function if there was no entry.

Link copied to clipboard
fun lastOrNull(): Int?

Returns the last value, or null if this pool contains no entry.

Link copied to clipboard
operator fun set(key: String, value: Int)

Allows to use the index operator for storing values in a pool.