org.mtzky.lucene
クラス LuceneIndex<E>

java.lang.Object
  上位を拡張 org.mtzky.lucene.LuceneIndex<E>
型パラメータ:
E - entity
すべての実装されたインタフェース:
Closeable, Closable

public class LuceneIndex<E>
extends Object
implements Closable

作成者:
mtzky

入れ子のクラスの概要
static interface LuceneIndex.WriterCallback<E>
           
 
コンストラクタの概要
LuceneIndex(LuceneDocumentDesc<E> desc)
           Creates instance with RAMDirectory.
LuceneIndex(LuceneDocumentDesc<E> desc, Directory dir)
           Creates instance with the specified directory.
 
メソッドの概要
 void close()
           
protected  LuceneIndexSearcher<E> createSearcher()
           
 Directory getDirectory()
           
 LuceneIndexSearcher<E> getSearcher()
           Requires IndexSearcher.close().
 LuceneIndexWriter<E> getWriter()
           Requires IndexWriter.close().
 boolean isClosed()
           
 void setDirectory(Directory directory)
           Switches new Directory from current Directory.
 void withWriter(LuceneIndex.WriterCallback<E> callback)
           Creates a new IndexWriter for this current Directory, passes it to the callback, and ensures the IndexWriter is closed after the callback returns.
 
クラス java.lang.Object から継承されたメソッド
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

LuceneIndex

public LuceneIndex(LuceneDocumentDesc<E> desc)
            throws CorruptIndexException,
                   IOException

Creates instance with RAMDirectory.

パラメータ:
desc -
例外:
IOException
CorruptIndexException
関連項目:
LuceneIndex(LuceneDocumentDesc, Directory)

LuceneIndex

public LuceneIndex(LuceneDocumentDesc<E> desc,
                   Directory dir)
            throws CorruptIndexException,
                   IOException

Creates instance with the specified directory.

パラメータ:
desc -
dir -
例外:
IOException
CorruptIndexException
メソッドの詳細

getDirectory

public Directory getDirectory()
戻り値:
a current Directory

setDirectory

public void setDirectory(Directory directory)
                  throws CorruptIndexException,
                         IOException

Switches new Directory from current Directory.

パラメータ:
directory - new Directory to switch from current Directory
例外:
IOException
CorruptIndexException

getWriter

public LuceneIndexWriter<E> getWriter()
                               throws CorruptIndexException,
                                      LockObtainFailedException,
                                      IOException

Requires IndexWriter.close().

戻り値:
IndexWriter of a current Directory
例外:
CorruptIndexException
LockObtainFailedException
IOException

withWriter

public void withWriter(LuceneIndex.WriterCallback<E> callback)
                throws CorruptIndexException,
                       LockObtainFailedException,
                       IOException

Creates a new IndexWriter for this current Directory, passes it to the callback, and ensures the IndexWriter is closed after the callback returns.

パラメータ:
callback - LuceneIndex.WriterCallback
例外:
CorruptIndexException
LockObtainFailedException
IOException
関連項目:
getWriter(), LuceneIndex.WriterCallback

getSearcher

public LuceneIndexSearcher<E> getSearcher()
                                   throws CorruptIndexException,
                                          IOException

Requires IndexSearcher.close().

戻り値:
IndexSearcher of a current Directory
例外:
CorruptIndexException
IOException

createSearcher

protected LuceneIndexSearcher<E> createSearcher()
                                         throws CorruptIndexException,
                                                IOException
戻り値:
IndexSearcher
例外:
CorruptIndexException
IOException
関連項目:
getSearcher(), getDirectory()

isClosed

public boolean isClosed()
定義:
インタフェース Closable 内の isClosed

close

public void close()
           throws IOException
定義:
インタフェース Closeable 内の close
例外:
IOException


Copyright (C) 2010-2011 Mtzky. AllRights Reserved.