When one of the item used in the cacheMap, first update the item used number.
When one of the item used in the cacheMap, first update the item used number.
key of the cacheMap.
Based on percent number, remove items from cacheMap.
Load object from either cacheMap or file.
Load object from either cacheMap or file. If the Object exist in cacheMap load it from cacheMap, otherwise load it from file and store it into cacheMap. When the cacheMap full, based on your preset strategy collect some of the items in cacheMap.
Need to preset: setCacheSize, setRemovePercent, addValueSerializer.
1. generate file name; 2. key in the cacheMap.
Object which type is T
Save 'value' to file.
Save 'value' to file.
Need to preset: addValueSerializer.
generate file name.
the Object (which type is T) you want to store.
Define the size of cacheMap.
Define the size of cacheMap.
It's an Int number which defines size of the cacheMap.
If the cacheMap is full, based on the percent defined here to remove proper percent of items from cacheMap.
If the cacheMap is full, based on the percent defined here to remove proper percent of items from cacheMap.
Percent of items need to remove.
Set serializer and unserializer to covert value to proper type.
Set serializer and unserializer to covert value to proper type.
serializer, which convert any type to string and put it to output stream.
unserializer, which get string from input stream and convert to any type.
Cache provider for save Object to predefined factory and load Object from cacheMap or factory.
For save Object you can use save[T](key: Cache.key, value: T) to save Object which type is T to factory.
For load Object you can use load[T](key: Cache.key), if the Object exist in cacheMap load it from cacheMap, if not load it from factory.
Use the cache provider you need to configuration the size of cacheMap, remove strategy, serializer and unSerializer.