Methods Summary |
---|
protected java.lang.Object | clone()
SegmentTermEnum clone = null;
try {
clone = (SegmentTermEnum) super.clone();
} catch (CloneNotSupportedException e) {}
clone.input = (InputStream) input.clone();
clone.termInfo = new TermInfo(termInfo);
if (term != null) clone.growBuffer(term.text.length());
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;
|
private final void | growBuffer(int length)
buffer = new char[length];
for (int i = 0; i < term.text.length(); i++) // copy contents
buffer[i] = term.text.charAt(i);
|
public final boolean | next()Increments the enumeration to the next element. True if one exists.
if (position++ >= size - 1) {
term = null;
return false;
}
prev = term;
term = readTerm();
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 long | proxPointer()
return termInfo.proxPointer;
|
private final org.apache.lucene.index.Term | readTerm()
int start = input.readVInt();
int length = input.readVInt();
int totalLength = start + length;
if (buffer.length < totalLength)
growBuffer(totalLength);
input.readChars(buffer, start, length);
return new Term(fieldInfos.fieldName(input.readVInt()),
new String(buffer, 0, totalLength), false);
|
final void | seek(long pointer, int p, org.apache.lucene.index.Term t, org.apache.lucene.index.TermInfo ti)
input.seek(pointer);
position = p;
term = t;
prev = null;
termInfo.set(ti);
growBuffer(term.text.length()); // copy term text into buffer
|
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 term;
|
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);
|