FileDocCategorySizeDatePackage
FilterIndexReader.javaAPI DocApache Lucene 2.2.06665Sat Jun 16 22:20:36 BST 2007org.apache.lucene.index

FilterIndexReader

public class FilterIndexReader extends IndexReader
A FilterIndexReader contains another IndexReader, which it uses as its basic source of data, possibly transforming the data along the way or providing additional functionality. The class FilterIndexReader itself simply implements all abstract methods of IndexReader with versions that pass all requests to the contained index reader. Subclasses of FilterIndexReader may further override some of these methods and may also provide additional methods and fields.

Fields Summary
protected IndexReader
in
Constructors Summary
public FilterIndexReader(IndexReader in)

Construct a FilterIndexReader based on the specified base reader. Directory locking for delete, undeleteAll, and setNorm operations is left to the base reader.

Note that base reader is closed if this FilterIndexReader is closed.

param
in specified base reader.

    super(in.directory());
    this.in = in;
  
Methods Summary
protected voiddoClose()

 in.close(); 
protected voiddoCommit()

 in.commit(); 
protected voiddoDelete(int n)

 in.deleteDocument(n); 
protected voiddoSetNorm(int d, java.lang.String f, byte b)

    in.setNorm(d, f, b);
  
protected voiddoUndeleteAll()

in.undeleteAll();
public intdocFreq(org.apache.lucene.index.Term t)

    ensureOpen();
    return in.docFreq(t);
  
public org.apache.lucene.document.Documentdocument(int n, org.apache.lucene.document.FieldSelector fieldSelector)

    ensureOpen();
    return in.document(n, fieldSelector);
  
public java.util.CollectiongetFieldNames(org.apache.lucene.index.IndexReader$FieldOption fieldNames)

    ensureOpen();
    return in.getFieldNames(fieldNames);
  
public org.apache.lucene.index.TermFreqVectorgetTermFreqVector(int docNumber, java.lang.String field)

    ensureOpen();
    return in.getTermFreqVector(docNumber, field);
  
public org.apache.lucene.index.TermFreqVector[]getTermFreqVectors(int docNumber)

    ensureOpen();
    return in.getTermFreqVectors(docNumber);
  
public longgetVersion()

    ensureOpen();
    return in.getVersion();
  
public booleanhasDeletions()

    // Don't call ensureOpen() here (it could affect performance)
    return in.hasDeletions();
  
public booleanhasNorms(java.lang.String field)

    ensureOpen();
    return in.hasNorms(field);
  
public booleanisCurrent()

    ensureOpen();
    return in.isCurrent();
  
public booleanisDeleted(int n)

    // Don't call ensureOpen() here (it could affect performance)
    return in.isDeleted(n);
  
public intmaxDoc()

    // Don't call ensureOpen() here (it could affect performance)
    return in.maxDoc();
  
public byte[]norms(java.lang.String f)

    ensureOpen();
    return in.norms(f);
  
public voidnorms(java.lang.String f, byte[] bytes, int offset)

    ensureOpen();
    in.norms(f, bytes, offset);
  
public intnumDocs()

    // Don't call ensureOpen() here (it could affect performance)
    return in.numDocs();
  
public org.apache.lucene.index.TermDocstermDocs()

    ensureOpen();
    return in.termDocs();
  
public org.apache.lucene.index.TermPositionstermPositions()

    ensureOpen();
    return in.termPositions();
  
public org.apache.lucene.index.TermEnumterms()

    ensureOpen();
    return in.terms();
  
public org.apache.lucene.index.TermEnumterms(org.apache.lucene.index.Term t)

    ensureOpen();
    return in.terms(t);