| Method from org.apache.lucene.index.SegmentTermEnum Detail: |
protected 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() throws IOException {
input.close();
}
Closes the enumeration to further activity, freeing resources. |
public final int docFreq() {
return termInfo.docFreq;
}
Returns the docFreq from the current TermInfo in the enumeration.
Initially invalid, valid after next() called for the first time. |
final long freqPointer() {
return termInfo.freqPointer;
}
|
public final boolean next() throws IOException {
if (position++ >= size - 1) {
prevBuffer.set(termBuffer);
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;
}
Increments the enumeration to the next element. True if one exists. |
final Term prev() {
return prevBuffer.toTerm();
}
Returns the previous Term enumerated. Initially null. |
final long proxPointer() {
return termInfo.proxPointer;
}
|
final void scanTo(Term term) throws IOException {
if (scratch == null)
scratch = new TermBuffer();
scratch.set(term);
while (scratch.compareTo(termBuffer) > 0 && next()) {}
}
Optimized scan, without allocating new terms. |
final void seek(long pointer,
int p,
Term t,
TermInfo ti) throws IOException {
input.seek(pointer);
position = p;
termBuffer.set(t);
prevBuffer.reset();
termInfo.set(ti);
}
|
public final Term term() {
return termBuffer.toTerm();
}
Returns the current Term in the enumeration.
Initially invalid, valid after next() called for the first time. |
final TermInfo termInfo() {
return new TermInfo(termInfo);
}
Returns the current TermInfo in the enumeration.
Initially invalid, valid after next() called for the first time. |
final void termInfo(TermInfo ti) {
ti.set(termInfo);
}
Sets the argument to the current TermInfo in the enumeration.
Initially invalid, valid after next() called for the first time. |