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
Extends
Dictionary
to provide caching of elements.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final class
private static final class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
protected
AbstractCachingDictionary
(boolean enableCaching) protected
protected
AbstractCachingDictionary
(MorphologicalProcessor morph, boolean enableCaching) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
cache
(DictionaryElementType fileType, POSKey key, Object obj) protected void
cacheException
(POSKey key, Exc exception) protected void
cacheIndexWord
(POSKey key, IndexWord word) protected void
cacheSynset
(POSKey key, Synset synset) void
void
clearCache
(DictionaryElementType elementType) int
private Object
getCached
(DictionaryElementType fileType, POSKey key) protected Exc
getCachedException
(POSKey key) protected IndexWord
getCachedIndexWord
(POSKey key) protected Synset
getCachedSynset
(POSKey key) int
boolean
void
setCacheCapacity
(int size) void
setCacheCapacity
(DictionaryElementType type, int size) void
setCachingEnabled
(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 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
-