net.sf.extjwnl.princeton.data
Class AbstractPrincetonDictionaryElementFactory

java.lang.Object
  extended by net.sf.extjwnl.princeton.data.AbstractPrincetonDictionaryElementFactory
All Implemented Interfaces:
Owned
Direct Known Subclasses:
AbstractPrincetonDatabaseDictionaryElementFactory, AbstractPrincetonFileDictionaryElementFactory

public abstract class AbstractPrincetonDictionaryElementFactory
extends Object
implements Owned

Base class for element factories. Holds some common code.

Author:

Field Summary
static String CACHE_STRINGS_KEY
          Whether to cache strings in .intern like manner.
protected  boolean cacheStrings
           
protected  Dictionary dictionary
           
protected  Pool<String> stringCache
           
 
Constructor Summary
AbstractPrincetonDictionaryElementFactory(Dictionary dictionary, Map<String,Param> params)
           
 
Method Summary
protected  Word createWord(Synset synset, int index, String lemma)
          Creates a word.
 Dictionary getDictionary()
          Returns the dictionary this object belongs to.
 void setDictionary(Dictionary dictionary)
          Sets the dictionary this object belongs to.
 void startCaching()
           
 void stopCaching()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dictionary

protected final Dictionary dictionary

CACHE_STRINGS_KEY

public static final String CACHE_STRINGS_KEY
Whether to cache strings in .intern like manner. Reduces memory snapshot for fully-loaded WordNets, default true. Applies on editing, when the WordNet is being fully cached.

See Also:
Constant Field Values

cacheStrings

protected boolean cacheStrings

stringCache

protected Pool<String> stringCache
Constructor Detail

AbstractPrincetonDictionaryElementFactory

public AbstractPrincetonDictionaryElementFactory(Dictionary dictionary,
                                                 Map<String,Param> params)
Method Detail

createWord

protected Word createWord(Synset synset,
                          int index,
                          String lemma)
Creates a word.

Parameters:
synset - synset
index - index
lemma - lemma
Returns:
word

setDictionary

public void setDictionary(Dictionary dictionary)
                   throws JWNLException
Description copied from interface: Owned
Sets the dictionary this object belongs to.

Specified by:
setDictionary in interface Owned
Parameters:
dictionary - the dictionary this object belongs to
Throws:
JWNLException - JWNLException

getDictionary

public Dictionary getDictionary()
Description copied from interface: Owned
Returns the dictionary this object belongs to.

Specified by:
getDictionary in interface Owned
Returns:
the dictionary this object belongs to

startCaching

public void startCaching()

stopCaching

public void stopCaching()


Copyright © 2013. All Rights Reserved.