public class MultipleTermPositions extends java.lang.Object implements TermPositions
| Constructor and Description |
|---|
MultipleTermPositions(IndexReader indexReader,
Term[] terms)
Creates a new
MultipleTermPositions instance. |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Frees associated resources.
|
int |
doc()
Returns the current document number.
|
int |
freq()
Returns the frequency of the term within the current document.
|
byte[] |
getPayload(byte[] data,
int offset)
Not implemented.
|
int |
getPayloadLength()
Not implemented.
|
boolean |
isPayloadAvailable()
Checks if a payload can be loaded at this position.
|
boolean |
next()
Moves to the next pair in the enumeration.
|
int |
nextPosition()
Returns next position in the current document.
|
int |
read(int[] arg0,
int[] arg1)
Not implemented.
|
void |
seek(Term arg0)
Not implemented.
|
void |
seek(TermEnum termEnum)
Not implemented.
|
boolean |
skipTo(int target)
Skips entries to the first beyond the current whose document number is
greater than or equal to target.
|
public MultipleTermPositions(IndexReader indexReader, Term[] terms) throws java.io.IOException
MultipleTermPositions instance.java.io.IOExceptionpublic final boolean next()
throws java.io.IOException
TermDocsReturns true iff there is such a next pair in the enumeration. Once this returns false you should not call any of the other methods.
public final int nextPosition()
TermPositionsTermDocs.freq() times
without calling TermDocs.next() This is
invalid until TermDocs.next() is called for
the first time.
nextPosition in interface TermPositionspublic final boolean skipTo(int target)
throws java.io.IOException
TermDocsReturns 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.public final int doc()
TermDocs This is invalid until TermDocs.next() is called for the first time.
public final int freq()
TermDocs This
is invalid until TermDocs.next() is called for the first time.
public final void close()
throws java.io.IOException
TermDocspublic void seek(Term arg0) throws java.io.IOException
public void seek(TermEnum termEnum) throws java.io.IOException
public int read(int[] arg0,
int[] arg1)
throws java.io.IOException
public int getPayloadLength()
getPayloadLength in interface TermPositionsjava.lang.UnsupportedOperationExceptionpublic byte[] getPayload(byte[] data,
int offset)
throws java.io.IOException
getPayload in interface TermPositionsdata - 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.java.lang.UnsupportedOperationExceptionjava.io.IOExceptionpublic boolean isPayloadAvailable()
TermPositions
Payloads can only be loaded once per call to
TermPositions.nextPosition().
isPayloadAvailable in interface TermPositionsCopyright © 2000-2022 Apache Software Foundation. All Rights Reserved.