Package net.didion.jwnl.dictionary
Class AbstractCachingDictionary
- java.lang.Object
-
- net.didion.jwnl.dictionary.Dictionary
-
- net.didion.jwnl.dictionary.AbstractCachingDictionary
-
- All Implemented Interfaces:
Installable
- Direct Known Subclasses:
DatabaseBackedDictionary,FileBackedDictionary
public abstract class AbstractCachingDictionary extends Dictionary
ExtendsDictionaryto provide caching of elements.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classAbstractCachingDictionary.DictionaryCacheSetprivate static classAbstractCachingDictionary.ObservableCache
-
Field Summary
Fields Modifier and Type Field Description private AbstractCachingDictionary.DictionaryCacheSet_cachesprivate boolean_isCachingEnabled
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractCachingDictionary()protectedAbstractCachingDictionary(boolean enableCaching)protectedAbstractCachingDictionary(MorphologicalProcessor morph)protectedAbstractCachingDictionary(MorphologicalProcessor morph, boolean enableCaching)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcache(DictionaryElementType fileType, POSKey key, java.lang.Object obj)protected voidcacheException(POSKey key, Exc exception)protected voidcacheIndexWord(POSKey key, IndexWord word)protected voidcacheSynset(POSKey key, Synset synset)voidclearCache()voidclearCache(DictionaryElementType elementType)intgetCacheCapacity(DictionaryElementType type)private java.lang.ObjectgetCached(DictionaryElementType fileType, POSKey key)protected ExcgetCachedException(POSKey key)protected IndexWordgetCachedIndexWord(POSKey key)protected SynsetgetCachedSynset(POSKey key)private AbstractCachingDictionary.DictionaryCacheSetgetCaches()intgetCacheSizes(DictionaryElementType type)booleanisCachingEnabled()voidsetCacheCapacity(int size)voidsetCacheCapacity(DictionaryElementType type, int size)voidsetCachingEnabled(boolean cachingEnabled)-
Methods inherited from class net.didion.jwnl.dictionary.Dictionary
close, getException, getExceptionIterator, getIndexWord, getIndexWordIterator, getIndexWordIterator, getInstance, getMorphologicalProcessor, getRandomIndexWord, getSynsetAt, getSynsetIterator, lookupAllIndexWords, lookupIndexWord, prepareQueryString, setDictionary, uninstall
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.didion.jwnl.util.factory.Installable
install
-
-
-
-
Field Detail
-
_caches
private AbstractCachingDictionary.DictionaryCacheSet _caches
-
_isCachingEnabled
private boolean _isCachingEnabled
-
-
Constructor Detail
-
AbstractCachingDictionary
protected AbstractCachingDictionary()
-
AbstractCachingDictionary
protected AbstractCachingDictionary(boolean enableCaching)
-
AbstractCachingDictionary
protected AbstractCachingDictionary(MorphologicalProcessor morph)
-
AbstractCachingDictionary
protected AbstractCachingDictionary(MorphologicalProcessor morph, boolean enableCaching)
-
-
Method Detail
-
isCachingEnabled
public boolean isCachingEnabled()
-
setCachingEnabled
public void setCachingEnabled(boolean cachingEnabled)
-
getCacheSizes
public int getCacheSizes(DictionaryElementType type)
-
getCacheCapacity
public int getCacheCapacity(DictionaryElementType type)
-
setCacheCapacity
public void setCacheCapacity(int size)
-
setCacheCapacity
public void setCacheCapacity(DictionaryElementType type, int size)
-
clearCache
public void clearCache()
-
clearCache
public void clearCache(DictionaryElementType elementType)
-
getCaches
private AbstractCachingDictionary.DictionaryCacheSet getCaches()
-
cache
private void cache(DictionaryElementType fileType, POSKey key, java.lang.Object obj)
-
getCached
private java.lang.Object getCached(DictionaryElementType fileType, POSKey key)
-
-