org.apache.lucene.index
Class MultipleTermPositions
- java.lang.Object
-
- org.apache.lucene.index.MultipleTermPositions
-
- All Implemented Interfaces:
- TermDocs, TermPositions
public class MultipleTermPositions extends java.lang.Object implements TermPositions
Describe classMultipleTermPositionshere.
-
-
Constructor Summary
Constructors Constructor and Description MultipleTermPositions(IndexReader indexReader, Term[] terms)Creates a newMultipleTermPositionsinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidclose()Frees associated resources.intdoc()Returns the current document number.intfreq()Returns the frequency of the term within the current document.byte[]getPayload(byte[] data, int offset)Not implemented.intgetPayloadLength()Not implemented.booleanisPayloadAvailable()Checks if a payload can be loaded at this position.booleannext()Moves to the next pair in the enumeration.intnextPosition()Returns next position in the current document.intread(int[] arg0, int[] arg1)Not implemented.voidseek(Term arg0)Not implemented.voidseek(TermEnum termEnum)Not implemented.booleanskipTo(int target)Skips entries to the first beyond the current whose document number is greater than or equal to target.
-
-
-
Constructor Detail
-
MultipleTermPositions
public MultipleTermPositions(IndexReader indexReader, Term[] terms) throws java.io.IOException
Creates a newMultipleTermPositionsinstance.- Throws:
java.io.IOException
-
-
Method Detail
-
next
public final boolean next() throws java.io.IOExceptionDescription copied from interface:TermDocsMoves to the next pair in the enumeration.Returns true iff there is such a next pair in the enumeration.
-
nextPosition
public final int nextPosition()
Description copied from interface:TermPositionsReturns next position in the current document. It is an error to call this more thanTermDocs.freq()times without callingTermDocs.next()This is invalid until
TermDocs.next()is called for the first time.- Specified by:
nextPositionin interfaceTermPositions
-
skipTo
public final boolean skipTo(int target) throws java.io.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.
-
doc
public final 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 final 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.
-
close
public final void close() throws java.io.IOExceptionDescription copied from interface:TermDocsFrees associated resources.
-
seek
public void seek(Term arg0) throws java.io.IOException
Not implemented.
-
seek
public void seek(TermEnum termEnum) throws java.io.IOException
Not implemented.
-
read
public int read(int[] arg0, int[] arg1) throws java.io.IOExceptionNot implemented.
-
getPayloadLength
public int getPayloadLength()
Not implemented.- Specified by:
getPayloadLengthin interfaceTermPositions- Returns:
- length of the current payload in number of bytes
- Throws:
java.lang.UnsupportedOperationException
-
getPayload
public byte[] getPayload(byte[] data, int offset) throws java.io.IOExceptionNot implemented.- Specified by:
getPayloadin interfaceTermPositions- Parameters:
data- the array into which the data of this payload is to be stored, if it is big enough; otherwise, a new byte[] array is allocated for this purpose.offset- the offset in the array into which the data of this payload is to be stored.- Returns:
- a byte[] array containing the data of this payload
- Throws:
java.lang.UnsupportedOperationExceptionjava.io.IOException
-
isPayloadAvailable
public boolean isPayloadAvailable()
Description copied from interface:TermPositionsChecks if a payload can be loaded at this position.Payloads can only be loaded once per call to
TermPositions.nextPosition().- Specified by:
isPayloadAvailablein interfaceTermPositions- Returns:
- false
-
-
DataMelt 3.0 © DataMelt by jWork.ORG