Methods Summary |
---|
protected java.lang.Object | clone()
SegmentTermEnum clone = null;
try {
clone = (SegmentTermEnum) super.clone();
} catch (CloneNotSupportedException e) {}
clone.input = (IndexInput) input.clone();
clone.termInfo = new TermInfo(termInfo);
clone.termBuffer = (TermBuffer)termBuffer.clone();
clone.prevBuffer = (TermBuffer)prevBuffer.clone();
clone.scratch = null;
return clone;
|
public final void | close()Closes the enumeration to further activity, freeing resources.
input.close();
|
public final int | docFreq()Returns the docFreq from the current TermInfo in the enumeration.
Initially invalid, valid after next() called for the first time.
return termInfo.docFreq;
|
final long | freqPointer()
return termInfo.freqPointer;
|
public final boolean | next()Increments the enumeration to the next element. True if one exists.
if (position++ >= size - 1) {
termBuffer.reset();
return false;
}
prevBuffer.set(termBuffer);
termBuffer.read(input, fieldInfos);
termInfo.docFreq = input.readVInt(); // read doc freq
termInfo.freqPointer += input.readVLong(); // read freq pointer
termInfo.proxPointer += input.readVLong(); // read prox pointer
if(format == -1){
// just read skipOffset in order to increment file pointer;
// value is never used since skipTo is switched off
if (!isIndex) {
if (termInfo.docFreq > formatM1SkipInterval) {
termInfo.skipOffset = input.readVInt();
}
}
}
else{
if (termInfo.docFreq >= skipInterval)
termInfo.skipOffset = input.readVInt();
}
if (isIndex)
indexPointer += input.readVLong(); // read index pointer
return true;
|
final org.apache.lucene.index.Term | prev()Returns the previous Term enumerated. Initially null.
return prevBuffer.toTerm();
|
final long | proxPointer()
return termInfo.proxPointer;
|
final void | scanTo(org.apache.lucene.index.Term term)Optimized scan, without allocating new terms.
if (scratch == null)
scratch = new TermBuffer();
scratch.set(term);
while (scratch.compareTo(termBuffer) > 0 && next()) {}
|
final void | seek(long pointer, int p, org.apache.lucene.index.Term t, org.apache.lucene.index.TermInfo ti)
input.seek(pointer);
position = p;
termBuffer.set(t);
prevBuffer.reset();
termInfo.set(ti);
|
public final org.apache.lucene.index.Term | term()Returns the current Term in the enumeration.
Initially invalid, valid after next() called for the first time.
return termBuffer.toTerm();
|
final org.apache.lucene.index.TermInfo | termInfo()Returns the current TermInfo in the enumeration.
Initially invalid, valid after next() called for the first time.
return new TermInfo(termInfo);
|
final void | termInfo(org.apache.lucene.index.TermInfo ti)Sets the argument to the current TermInfo in the enumeration.
Initially invalid, valid after next() called for the first time.
ti.set(termInfo);
|