Class SerializableCache<K,V>
java.lang.Object
org.biojava.nbio.structure.domain.SerializableCache<K,V>
- Type Parameters:
K
- The key type of the cacheV
- the value type to be stored on the cache
A class that provides all that is necessary to create a Serializable Cache
- Since:
- 3.0.3
- Author:
- Andreas Prlic
-
Field Summary
-
Constructor Summary
ConstructorDescriptionSerializableCache
(String cacheFileName) set cacheFileName to null to disable caching -
Method Summary
Modifier and TypeMethodDescriptionvoid
This will not cache null values.void
void
void
boolean
-
Field Details
-
cacheFileName
-
serializedCache
-
-
Constructor Details
-
SerializableCache
set cacheFileName to null to disable caching- Parameters:
cacheFileName
-
-
-
Method Details
-
isCacheEnabled
-
cache
This will not cache null values. Null means not cached yet. If you want to cache "no data exists" use e.g. empty collections to represent this.- Parameters:
name
-data
-
-
get
-
disableCache
-
enableCache
-
reloadFromFile
-
flushCache
-