Class AbstractCachingDictionary
java.lang.Object
net.didion.jwnl.dictionary.Dictionary
net.didion.jwnl.dictionary.AbstractCachingDictionary
- All Implemented Interfaces:
Installable
- Direct Known Subclasses:
DatabaseBackedDictionary, FileBackedDictionary
Extends
Dictionary to provide caching of elements.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classprivate static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedprotectedAbstractCachingDictionary(boolean enableCaching) protectedprotectedAbstractCachingDictionary(MorphologicalProcessor morph, boolean enableCaching) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcache(DictionaryElementType fileType, POSKey key, Object obj) protected voidcacheException(POSKey key, Exc exception) protected voidcacheIndexWord(POSKey key, IndexWord word) protected voidcacheSynset(POSKey key, Synset synset) voidvoidclearCache(DictionaryElementType elementType) intprivate ObjectgetCached(DictionaryElementType fileType, POSKey key) protected ExcgetCachedException(POSKey key) protected IndexWordgetCachedIndexWord(POSKey key) protected SynsetgetCachedSynset(POSKey key) intbooleanvoidsetCacheCapacity(int size) voidsetCacheCapacity(DictionaryElementType type, int size) voidsetCachingEnabled(boolean cachingEnabled) Methods inherited from class Dictionary
close, getException, getExceptionIterator, getIndexWord, getIndexWordIterator, getIndexWordIterator, getInstance, getMorphologicalProcessor, getRandomIndexWord, getSynsetAt, getSynsetIterator, lookupAllIndexWords, lookupIndexWord, prepareQueryString, setDictionary, uninstallMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Installable
install
-
Field Details
-
_caches
-
_isCachingEnabled
private boolean _isCachingEnabled
-
-
Constructor Details
-
AbstractCachingDictionary
protected AbstractCachingDictionary() -
AbstractCachingDictionary
protected AbstractCachingDictionary(boolean enableCaching) -
AbstractCachingDictionary
-
AbstractCachingDictionary
-
-
Method Details
-
isCachingEnabled
public boolean isCachingEnabled() -
setCachingEnabled
public void setCachingEnabled(boolean cachingEnabled) -
getCacheSizes
-
getCacheCapacity
-
setCacheCapacity
public void setCacheCapacity(int size) -
setCacheCapacity
-
clearCache
public void clearCache() -
clearCache
-
cacheIndexWord
-
getCachedIndexWord
-
cacheSynset
-
getCachedSynset
-
cacheException
-
getCachedException
-
getCaches
-
cache
-
getCached
-