◆ LruLoadingCache()
fiftyone.caching.LruLoadingCache< K, V >.LruLoadingCache | ( | int | cacheSize, |
ValueLoader< K, V > | loader | ||
) |
Constructs a new instance of the cache.
- Parameters
-
- cacheSize - the number of items to store in the cache
- loader - the loader used to fetch items not already in the cache
Member Function Documentation
◆ get() [1/2]
V fiftyone.caching.LruLoadingCache< K, V >.get ( K key ) Retrieves the value for key requested.
If the key does not exist in the cache then the Fetch method of the cache's loader is used to retrieve the value.
- Parameters
-
- key - of the item required.
- Returns
- an instance of the value associated with the key
- Exceptions
-
- IllegalStateException - if there was a problem accessing data file
Implements fiftyone.caching.Cache< K, V >.
◆ get() [2/2]
V fiftyone.caching.LruLoadingCache< K, V >.get ( K key, ValueLoader< K, V > loader ) throws IOException Retrieves the value for key requested.
If the key does not exist in the cache then the Fetch method is used to retrieve the value from another loader.
- Parameters
-
- key - of the item required
- loader - to fetch the items from
- Returns
- an instance of the value associated with the key
- Exceptions
-
- java.io.IOException - if there was a problem accessing data file
Implements fiftyone.caching.LoadingCache< K, V >.
◆ setCacheLoader()
void fiftyone.caching.LruLoadingCache< K, V >.setCacheLoader ( ValueLoader< K, V > loader ) Set the loader used to fetch items not in the cache.
- Parameters
-
- loader - the loader to use