public class

MultipleTermPositions

extends Object
implements TermPositions
java.lang.Object
   ↳ org.apache.lucene.index.MultipleTermPositions

Class Overview

Allows you to iterate over the TermPositions for multiple Terms as a single TermPositions.

Summary

Public Constructors
MultipleTermPositions(IndexReader indexReader, Term[] terms)
Creates a new MultipleTermPositions instance.
Public Methods
final void close()
Frees associated resources.
final int doc()
Returns the current document number.
final 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.
final boolean next()
Moves to the next pair in the enumeration.
final int nextPosition()
Returns next position in the current document.
int read(int[] arg0, int[] arg1)
Not implemented.
void seek(TermEnum termEnum)
Not implemented.
void seek(Term arg0)
Not implemented.
final boolean skipTo(int target)
Skips entries to the first beyond the current whose document number is greater than or equal to target.
[Expand]
Inherited Methods
From class java.lang.Object
From interface java.io.Closeable
From interface org.apache.lucene.index.TermDocs
From interface org.apache.lucene.index.TermPositions

Public Constructors

public MultipleTermPositions (IndexReader indexReader, Term[] terms)

Creates a new MultipleTermPositions instance.

Throws
IOException

Public Methods

public final void close ()

Frees associated resources.

Throws
IOException

public final int doc ()

Returns the current document number.

This is invalid until next() is called for the first time.

public final int freq ()

Returns the frequency of the term within the current document.

This is invalid until next() is called for the first time.

public byte[] getPayload (byte[] data, int offset)

Not implemented.

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

public int getPayloadLength ()

Not implemented.

Returns
  • length of the current payload in number of bytes

public boolean isPayloadAvailable ()

Checks if a payload can be loaded at this position.

Payloads can only be loaded once per call to nextPosition().

Returns
  • false

public final boolean next ()

Moves to the next pair in the enumeration.

Returns true iff there is such a next pair in the enumeration.

Throws
IOException

public final int nextPosition ()

Returns next position in the current document. It is an error to call this more than freq() times without calling next()

This is invalid until next() is called for the first time.

public int read (int[] arg0, int[] arg1)

Not implemented.

public void seek (TermEnum termEnum)

Not implemented.

public void seek (Term arg0)

Not implemented.

public final boolean skipTo (int target)

Skips 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.

Throws
IOException