Package org.apache.lucene.index
Class FilterIndexReader.FilterTermDocs
- java.lang.Object
-
- org.apache.lucene.index.FilterIndexReader.FilterTermDocs
-
- All Implemented Interfaces:
Closeable,AutoCloseable,TermDocs
- Direct Known Subclasses:
FilterIndexReader.FilterTermPositions
- Enclosing class:
- FilterIndexReader
public static class FilterIndexReader.FilterTermDocs extends Object implements TermDocs
Base class for filteringTermDocsimplementations.
-
-
Constructor Summary
Constructors Constructor Description FilterTermDocs(TermDocs in)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()Frees associated resources.intdoc()Returns the current document number.intfreq()Returns the frequency of the term within the current document.booleannext()Moves to the next pair in the enumeration.intread(int[] docs, int[] freqs)Attempts to read multiple entries from the enumeration, up to length of docs.voidseek(Term term)Sets this to the data for a term.voidseek(TermEnum termEnum)Sets this to the data for the current term in aTermEnum.booleanskipTo(int i)Skips entries to the first beyond the current whose document number is greater than or equal to target.
-
-
-
Field Detail
-
in
protected TermDocs in
-
-
Constructor Detail
-
FilterTermDocs
public FilterTermDocs(TermDocs in)
-
-
Method Detail
-
seek
public void seek(Term term) throws IOException
Description copied from interface:TermDocsSets this to the data for a term. The enumeration is reset to the start of the data for this term.- Specified by:
seekin interfaceTermDocs- Throws:
IOException
-
seek
public void seek(TermEnum termEnum) throws IOException
Description copied from interface:TermDocsSets this to the data for the current term in aTermEnum. This may be optimized in some implementations.- Specified by:
seekin interfaceTermDocs- Throws:
IOException
-
doc
public int doc()
Description copied from interface:TermDocsReturns the current document number.This is invalid until
TermDocs.next()is called for the first time.
-
freq
public int freq()
Description copied from interface:TermDocsReturns the frequency of the term within the current document.This is invalid until
TermDocs.next()is called for the first time.
-
next
public boolean next() throws IOExceptionDescription copied from interface:TermDocsMoves to the next pair in the enumeration.Returns true iff there is such a next pair in the enumeration. Once this returns false you should not call any of the other methods.
- Specified by:
nextin interfaceTermDocs- Throws:
IOException
-
read
public int read(int[] docs, int[] freqs) throws IOExceptionDescription copied from interface:TermDocsAttempts to read multiple entries from the enumeration, up to length of docs. Document numbers are stored in docs, and term frequencies are stored in freqs. The freqs array must be as long as the docs array.Returns the number of entries read. Zero is only returned when the stream has been exhausted.
- Specified by:
readin interfaceTermDocs- Throws:
IOException
-
skipTo
public boolean skipTo(int i) throws IOExceptionDescription copied from interface:TermDocsSkips entries to the first beyond the current whose document number is greater than or equal to target.Returns true iff there is such an entry.
Behaves as if written:
boolean skipTo(int target) { do { if (!next()) return false; } while (target > doc()); return true; }Some implementations are considerably more efficient than that.- Specified by:
skipToin interfaceTermDocs- Throws:
IOException
-
close
public void close() throws IOExceptionDescription copied from interface:TermDocsFrees associated resources.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceTermDocs- Throws:
IOException
-
-