|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.extjwnl.dictionary.Dictionary
net.sf.extjwnl.dictionary.AbstractCachingDictionary
public abstract class AbstractCachingDictionary
Extends Dictionary
to provide caching of elements.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.sf.extjwnl.dictionary.Dictionary |
---|
Dictionary.Version |
Field Summary | |
---|---|
protected boolean |
isCachingEnabled
|
Fields inherited from class net.sf.extjwnl.dictionary.Dictionary |
---|
CHECK_LEX_IDS_KEY, maxOffset, params |
Constructor Summary | |
---|---|
protected |
AbstractCachingDictionary(Document doc)
|
Method Summary | |
---|---|
void |
addException(Exc exc)
Adds exception to the dictionary. |
void |
addIndexWord(IndexWord indexWord)
Adds index word to the dictionary. |
void |
addSynset(Synset synset)
Adds synset to the dictionary. |
protected void |
cacheAll()
|
protected void |
cacheException(POSKey key,
Exc exception)
|
protected void |
cacheIndexWord(POSKey key,
IndexWord word)
|
protected void |
cachePOS(POS pos)
|
void |
cacheSynset(POSKey key,
Synset synset)
|
void |
clearCache()
|
void |
clearCache(DictionaryElementType elementType)
|
protected void |
clearException(POSKey key)
|
protected void |
clearIndexWord(POSKey key)
|
void |
clearSynset(POSKey key)
|
void |
edit()
Puts the dictionary into edit mode. |
int |
getCacheCapacity(DictionaryElementType type)
|
protected Exc |
getCachedException(POSKey key)
|
protected IndexWord |
getCachedIndexWord(POSKey key)
|
protected Synset |
getCachedSynset(POSKey key)
|
int |
getCacheSizes(DictionaryElementType type)
|
Iterator<Exc> |
getExceptionIterator(POS pos)
Return an Iterator over all the Exceptions in the database. |
Iterator<IndexWord> |
getIndexWordIterator(POS pos)
Return an Iterator over all the IndexWords of part-of-speech pos in the database. |
Iterator<IndexWord> |
getIndexWordIterator(POS pos,
String substring)
Return an Iterator over all the IndexWords of part-of-speech pos whose lemmas contain substring as a substring. |
Iterator<Synset> |
getSynsetIterator(POS pos)
Return an Iterator over all the Synsets of part-of-speech pos in the database. |
boolean |
isCachingEnabled()
|
void |
removeException(Exc exc)
Removes the exc from the dictionary. |
void |
removeIndexWord(IndexWord indexWord)
Removes indexWord from the dictionary. |
void |
removeSynset(Synset synset)
Removes synset from the dictionary. |
void |
setCacheCapacity(DictionaryElementType type,
int size)
|
void |
setCacheCapacity(int size)
|
void |
setCachingEnabled(boolean cachingEnabled)
|
Methods inherited from class net.sf.extjwnl.dictionary.Dictionary |
---|
addElement, close, createException, createIndexWord, createSynset, delete, getDatabaseBackedInstance, getException, getFileBackedInstance, getIndexWord, getInstance, getInstance, getInstance, getMapBackedInstance, getMorphologicalProcessor, getRandomIndexWord, getRestoreDictionary, getSynsetAt, getVersion, isEditable, lookupAllIndexWords, lookupIndexWord, prepareQueryString, removeElement, save, setInstance, setMorphologicalProcessor, setRestoreDictionary, uninstall |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean isCachingEnabled
Constructor Detail |
---|
protected AbstractCachingDictionary(Document doc) throws JWNLException
JWNLException
Method Detail |
---|
public boolean isCachingEnabled()
public void setCachingEnabled(boolean cachingEnabled)
public int getCacheSizes(DictionaryElementType type)
public int getCacheCapacity(DictionaryElementType type)
public void setCacheCapacity(int size)
public void setCacheCapacity(DictionaryElementType type, int size)
public void clearCache()
public void clearCache(DictionaryElementType elementType)
protected void cacheIndexWord(POSKey key, IndexWord word)
protected void clearIndexWord(POSKey key)
protected IndexWord getCachedIndexWord(POSKey key)
public void cacheSynset(POSKey key, Synset synset)
public void clearSynset(POSKey key)
protected Synset getCachedSynset(POSKey key)
protected void cacheException(POSKey key, Exc exception)
protected void clearException(POSKey key)
protected Exc getCachedException(POSKey key)
public Iterator<Exc> getExceptionIterator(POS pos) throws JWNLException
Dictionary
getExceptionIterator
in class Dictionary
pos
- the part-of-speech
Exc
s
JWNLException
- JWNLExceptionpublic Iterator<Synset> getSynsetIterator(POS pos) throws JWNLException
Dictionary
getSynsetIterator
in class Dictionary
pos
- The part-of-speech.
Synset
s.
JWNLException
- JWNLExceptionpublic Iterator<IndexWord> getIndexWordIterator(POS pos) throws JWNLException
Dictionary
getIndexWordIterator
in class Dictionary
pos
- The part-of-speech
IndexWord
s
JWNLException
- JWNLExceptionpublic Iterator<IndexWord> getIndexWordIterator(POS pos, String substring) throws JWNLException
Dictionary
getIndexWordIterator
in class Dictionary
pos
- The part-of-speech.substring
- substring
IndexWord
s.
JWNLException
- JWNLExceptionpublic void edit() throws JWNLException
Dictionary
edit
in class Dictionary
JWNLException
- JWNLExceptionpublic void addSynset(Synset synset) throws JWNLException
Dictionary
addSynset
in class Dictionary
synset
- synset to add
JWNLException
- JWNLExceptionpublic void removeSynset(Synset synset) throws JWNLException
Dictionary
removeSynset
in class Dictionary
synset
- synset to remove
JWNLException
- JWNLExceptionpublic void addException(Exc exc) throws JWNLException
Dictionary
addException
in class Dictionary
exc
- exception to add
JWNLException
- JWNLExceptionpublic void removeException(Exc exc) throws JWNLException
Dictionary
removeException
in class Dictionary
exc
- exc to be removed
JWNLException
- JWNLExceptionpublic void addIndexWord(IndexWord indexWord) throws JWNLException
Dictionary
addIndexWord
in class Dictionary
indexWord
- index word to add
JWNLException
- JWNLExceptionpublic void removeIndexWord(IndexWord indexWord) throws JWNLException
Dictionary
removeIndexWord
in class Dictionary
indexWord
- index word to remove
JWNLException
- JWNLExceptionprotected void cacheAll() throws JWNLException
JWNLException
protected void cachePOS(POS pos) throws JWNLException
JWNLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |