kvision / pl.treksoft.kvision.utils / Cache

Cache

(js) class Cache<K, V>

This is a LRU cache that has no performance impact for cache insertions once the capacity of the cache has been reached. For cache hit, performance is O(1) and for cache eviction, it is O(1).

Constructors

(js)

<init>

This is a LRU cache that has no performance impact for cache insertions once the capacity of the cache has been reached. For cache hit, performance is O(1) and for cache eviction, it is O(1).

Cache(capacity: Int = 50)

Functions

(js)

get

HashMap get is O(1). More info: https://stackoverflow.com/a/4578039/2085356

operator fun get(key: K): V?
(js)

set

HashMap put and remove is O(1). More info: https://stackoverflow.com/a/4578039/2085356

operator fun set(key: K, value: V): K?
(js)

toString

fun toString(): String