K
- The key type of the cacheV
- the value type to be stored on the cachepublic class SerializableCache<K,V> extends Object
Modifier and Type | Field and Description |
---|---|
protected String |
cacheFileName |
protected Map<K,V> |
serializedCache |
Constructor and Description |
---|
SerializableCache(String cacheFileName)
set cacheFileName to null to disable caching
|
Modifier and Type | Method and Description |
---|---|
void |
cache(K name,
V data)
This will not cache null values.
|
void |
disableCache() |
void |
enableCache() |
void |
flushCache() |
V |
get(K name) |
boolean |
isCacheEnabled() |
Map<K,V> |
reloadFromFile() |
protected String cacheFileName
protected Map<K,V> serializedCache
public SerializableCache(String cacheFileName)
cacheFileName
- public boolean isCacheEnabled()
public void cache(K name, V data)
name
- data
- public void disableCache()
public void enableCache()
public Map<K,V> reloadFromFile()
public void flushCache()
Copyright © 2000–2018 BioJava. All rights reserved.