/// <summary> /// Increments the enumeration to the next element. True if one exists. </summary> public bool Next() { prevBuffer.Set(termBuffer); //System.out.println(" ste setPrev=" + prev() + " this=" + this); if (position++ >= size - 1) { termBuffer.Reset(); //System.out.println(" EOF"); return(false); } termBuffer.Read(input, fieldInfos); newSuffixStart = termBuffer.newSuffixStart; termInfo.DocFreq = input.ReadVInt32(); // read doc freq termInfo.FreqPointer += input.ReadVInt64(); // read freq pointer termInfo.ProxPointer += input.ReadVInt64(); // read prox pointer if (termInfo.DocFreq >= skipInterval) { termInfo.SkipOffset = input.ReadVInt32(); } if (isIndex) { indexPointer += input.ReadVInt64(); // read index pointer } //System.out.println(" ste ret term=" + term()); return(true); }
internal void Seek(long pointer, long p, Term t, TermInfo ti) { input.Seek(pointer); position = p; termBuffer.Set(t); prevBuffer.Reset(); //System.out.println(" ste doSeek prev=" + prevBuffer.toTerm() + " this=" + this); termInfo.Set(ti); first = p == -1; }
/* Optimized scan, without allocating new terms. * Return number of invocations to next(). * * NOTE: LUCENE-3183: if you pass Term("", "") here then this * will incorrectly return before positioning the enum, * and position will be -1; caller must detect this. */ internal int ScanTo(Term term) { scanBuffer.Set(term); int count = 0; if (first) { // Always force initial next() in case term is // Term("", "") Next(); first = false; count++; } while (scanBuffer.CompareTo(termBuffer) > 0 && Next()) { count++; } return(count); }