Cache

floodsim.view.util.resource.Cache
See theCache companion trait
object Cache

Companion object for Cache providing factory methods.

Attributes

Companion
trait
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Cache.type

Members list

Value members

Concrete methods

def preloaded[K, A](keys: Iterable[K])(using loader: ResourceLoader[K, A]): Cache[K, A]

Creates a preloaded cache with the specified keys. This method eagerly loads all resources for the given keys using the provided loader.

Creates a preloaded cache with the specified keys. This method eagerly loads all resources for the given keys using the provided loader.

Type parameters

A

the type of resources stored in the cache

K

the type of keys used to identify resources

Value parameters

keys

the collection of keys to preload

loader

the resource loader to use for loading resources

Attributes

Returns

a new Cache containing the preloaded resources