Package com.e1c.langtool.external.cache
Class TranslationCache
java.lang.Object
com.e1c.langtool.external.cache.TranslationCache
- All Implemented Interfaces:
ICache<TranslationQueryEntity,,TranslationResultEntity> ITranslationCacheManager.ITranslationCache
The realization of a cache of translations based on MapDB.
-
Constructor Summary
ConstructorsConstructorDescriptionTranslationCache(String path, String name) Creates a new cache of translations. -
Method Summary
Modifier and TypeMethodDescriptiongetAll()voidput(TranslationQueryEntity key, TranslationResultEntity value) voidputAll(Map<? extends TranslationQueryEntity, ? extends TranslationResultEntity> map) voidvoidvoidlongsize()
-
Constructor Details
-
TranslationCache
Creates a new cache of translations.- Parameters:
path- the path to database storage directoryname- the name of databaseserializersFactory- the factory to create serializers for translation queries and results- Throws:
IOError- if it can't to create or open the database file
-
-
Method Details
-
put
- Specified by:
putin interfaceICache<TranslationQueryEntity,TranslationResultEntity>
-
putAll
- Specified by:
putAllin interfaceICache<TranslationQueryEntity,TranslationResultEntity>
-
get
- Specified by:
getin interfaceICache<TranslationQueryEntity,TranslationResultEntity>
-
remove
- Specified by:
removein interfaceICache<TranslationQueryEntity,TranslationResultEntity>
-
removeAll
- Specified by:
removeAllin interfaceICache<TranslationQueryEntity,TranslationResultEntity>
-
removeAll
public void removeAll()- Specified by:
removeAllin interfaceICache<TranslationQueryEntity,TranslationResultEntity>
-
size
public long size()- Specified by:
sizein interfaceICache<TranslationQueryEntity,TranslationResultEntity>
-
getAll
- Specified by:
getAllin interfaceICache<TranslationQueryEntity,TranslationResultEntity>
-