LongPool

object LongPool : ObjectPool<Long>

Long Pool

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

Example:

LongPool["key"] = 1L

Since

1.4.0

See also

Properties

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

Pool size

Functions

Link copied to clipboard
fun first(): Long

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

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

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

Link copied to clipboard
fun firstOrNull(): Long?

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

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

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: () -> Long): Long

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): Long?

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(): Long

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

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

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

Link copied to clipboard
fun lastOrNull(): Long?

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

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

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