| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.lucene.index.MultipleTermPositions
public class MultipleTermPositions
Allows you to iterate over the TermPositions for multiple Terms as
 a single TermPositions.
| Constructor Summary | |
|---|---|
| MultipleTermPositions(IndexReader indexReader,
                      Term[] terms)Creates a new MultipleTermPositionsinstance. | |
| Method Summary | |
|---|---|
|  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. | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Constructor Detail | 
|---|
public MultipleTermPositions(IndexReader indexReader,
                             Term[] terms)
                      throws IOException
MultipleTermPositions instance.
IOException| Method Detail | 
|---|
public final boolean next()
                   throws IOException
TermDocsReturns true iff there is such a next pair in the enumeration.
next in interface TermDocsIOExceptionpublic 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 TermPositions
public final boolean skipTo(int target)
                     throws 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.
skipTo in interface TermDocsIOExceptionpublic final int doc()
TermDocs This is invalid until TermDocs.next() is called for the first time.
doc in interface TermDocspublic final int freq()
TermDocs This
   is invalid until TermDocs.next() is called for the first time.
freq in interface TermDocs
public final void close()
                 throws IOException
TermDocs
close in interface Closeableclose in interface TermDocsIOException
public void seek(Term arg0)
          throws IOException
seek in interface TermDocsUnsupportedOperationException
IOException
public void seek(TermEnum termEnum)
          throws IOException
seek in interface TermDocsUnsupportedOperationException
IOException
public int read(int[] arg0,
                int[] arg1)
         throws IOException
read in interface TermDocsUnsupportedOperationException
IOExceptionpublic int getPayloadLength()
getPayloadLength in interface TermPositionsUnsupportedOperationException
public byte[] getPayload(byte[] data,
                         int offset)
                  throws 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.
UnsupportedOperationException
IOExceptionpublic boolean isPayloadAvailable()
TermPositions
 Payloads can only be loaded once per call to 
 TermPositions.nextPosition().
isPayloadAvailable in interface TermPositions| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||