org.apache.lucene.index
Class TermInfosReader

Object
  extended by TermInfosReader

final class TermInfosReader
extends Object

This stores a monotonically increasing set of pairs in a Directory. Pairs are accessed either by Term or by ordinal position the set.


Field Summary
private  Directory directory
           
private  ThreadLocal enumerators
           
private  FieldInfos fieldInfos
           
private  SegmentTermEnum indexEnum
           
private  TermInfo[] indexInfos
           
private  long[] indexPointers
           
private  Term[] indexTerms
           
private  SegmentTermEnum origEnum
           
private  String segment
           
private  long size
           
 
Constructor Summary
TermInfosReader(Directory dir, String seg, FieldInfos fis)
           
 
Method Summary
(package private)  void close()
           
private  void ensureIndexIsRead()
           
(package private)  Term get(int position)
          Returns the nth term in the set.
(package private)  TermInfo get(Term term)
          Returns the TermInfo for a Term in the set, or null.
private  SegmentTermEnum getEnum()
           
private  int getIndexOffset(Term term)
          Returns the offset of the greatest index entry which is less than or equal to term.
(package private)  long getPosition(Term term)
          Returns the position of a Term in the set or -1.
 int getSkipInterval()
           
private  Term scanEnum(int position)
           
private  TermInfo scanEnum(Term term)
          Scans within block for matching term.
private  void seekEnum(int indexOffset)
           
(package private)  long size()
          Returns the number of term/value pairs in the set.
 SegmentTermEnum terms()
          Returns an enumeration of all the Terms and TermInfos in the set.
 SegmentTermEnum terms(Term term)
          Returns an enumeration of terms starting at or after the named term.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

directory

private Directory directory

segment

private String segment

fieldInfos

private FieldInfos fieldInfos

enumerators

private ThreadLocal enumerators

origEnum

private SegmentTermEnum origEnum

size

private long size

indexTerms

private Term[] indexTerms

indexInfos

private TermInfo[] indexInfos

indexPointers

private long[] indexPointers

indexEnum

private SegmentTermEnum indexEnum
Constructor Detail

TermInfosReader

TermInfosReader(Directory dir,
                String seg,
                FieldInfos fis)
          throws IOException
Throws:
IOException
Method Detail

getSkipInterval

public int getSkipInterval()

close

final void close()
          throws IOException
Throws:
IOException

size

final long size()
Returns the number of term/value pairs in the set.


getEnum

private SegmentTermEnum getEnum()

ensureIndexIsRead

private void ensureIndexIsRead()
                        throws IOException
Throws:
IOException

getIndexOffset

private final int getIndexOffset(Term term)
Returns the offset of the greatest index entry which is less than or equal to term.


seekEnum

private final void seekEnum(int indexOffset)
                     throws IOException
Throws:
IOException

get

TermInfo get(Term term)
       throws IOException
Returns the TermInfo for a Term in the set, or null.

Throws:
IOException

scanEnum

private final TermInfo scanEnum(Term term)
                         throws IOException
Scans within block for matching term.

Throws:
IOException

get

final Term get(int position)
        throws IOException
Returns the nth term in the set.

Throws:
IOException

scanEnum

private final Term scanEnum(int position)
                     throws IOException
Throws:
IOException

getPosition

final long getPosition(Term term)
                throws IOException
Returns the position of a Term in the set or -1.

Throws:
IOException

terms

public SegmentTermEnum terms()
Returns an enumeration of all the Terms and TermInfos in the set.


terms

public SegmentTermEnum terms(Term term)
                      throws IOException
Returns an enumeration of terms starting at or after the named term.

Throws:
IOException