org.sourceforge.beanindex.store.writer
Class DictionaryWriter

java.lang.Object
  extended byorg.sourceforge.beanindex.store.writer.DictionaryWriter
Direct Known Subclasses:
RAMDictionaryWriter, VMDictionaryWriter

public abstract class DictionaryWriter
extends java.lang.Object


Constructor Summary
DictionaryWriter()
           
 
Method Summary
abstract  void add(int beanId, java.lang.String keywords, java.lang.reflect.Field field, int fieldIndex, java.lang.String indexName)
           
abstract  void close()
           
protected  int findItemIndex(java.lang.String[] items, java.lang.String item)
          Method returns the index position of a given string in a string array.
static DictionaryWriter getInstance(java.lang.String path, java.lang.String[] indexNames)
           
static DictionaryWriter getInstance(java.lang.String path, java.lang.String[] indexNames, VirtualMemory vm)
           
protected  java.util.Iterator removeDuplicates(java.lang.String keywords)
          Method to remove any duplicate keywords in the string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DictionaryWriter

public DictionaryWriter()
Method Detail

getInstance

public static DictionaryWriter getInstance(java.lang.String path,
                                           java.lang.String[] indexNames)
                                    throws java.lang.Exception
Parameters:
path -
indexNames -
Returns:
DictionaryWriter
Throws:
java.lang.Exception

getInstance

public static DictionaryWriter getInstance(java.lang.String path,
                                           java.lang.String[] indexNames,
                                           VirtualMemory vm)
                                    throws java.lang.Exception
Parameters:
path -
indexNames -
vm -
Returns:
DictionaryWriter
Throws:
java.lang.Exception

add

public abstract void add(int beanId,
                         java.lang.String keywords,
                         java.lang.reflect.Field field,
                         int fieldIndex,
                         java.lang.String indexName)
                  throws java.lang.Exception
Throws:
java.lang.Exception

close

public abstract void close()
                    throws java.lang.Exception
Throws:
java.lang.Exception

removeDuplicates

protected java.util.Iterator removeDuplicates(java.lang.String keywords)
Method to remove any duplicate keywords in the string

Parameters:
keywords -
Returns:
Iterator

findItemIndex

protected int findItemIndex(java.lang.String[] items,
                            java.lang.String item)
Method returns the index position of a given string in a string array.

Parameters:
items -
item -
Returns:
int