Lucene.Net  3.0.3
Lucene.Net is a port of the Lucene search engine library, written in C# and targeted at .NET runtime users.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Pages
Public Member Functions | Static Public Attributes | List of all members
Lucene.Net.Search.DocIdSetIterator Class Referenceabstract

This abstract class defines methods to iterate over a set of non-decreasing doc ids. Note that this class assumes it iterates on doc Ids, and therefore NO_MORE_DOCS is set to Int32.MaxValue in order to be used as a sentinel object. Implementations of this class are expected to consider int.MaxValue as an invalid value. More...

Inherited by Lucene.Net.Search.DocIdSet.AnonymousClassDocIdSet.AnonymousClassDocIdSetIterator, Lucene.Net.Search.FieldCacheTermsFilter.FieldCacheTermsFilterDocIdSet.FieldCacheTermsFilterDocIdSetIterator, Lucene.Net.Search.FilteredDocIdSetIterator, Lucene.Net.Search.Scorer, and Lucene.Net.Spatial.Util.FixedBitSet.FixedBitSetIterator.

Public Member Functions

abstract int DocID ()
 Returns the following:


 
abstract int NextDoc ()
 Advances to the next document in the set and returns the doc it is currently on, or NO_MORE_DOCS if there are no more docs in the set.

 
abstract int Advance (int target)
 Advances to the first beyond the current whose document number is greater than or equal to target. Returns the current document number or NO_MORE_DOCS if there are no more docs in the set. Behaves as if written:
 

Static Public Attributes

static readonly int NO_MORE_DOCS = System.Int32.MaxValue
 When returned by NextDoc(), Advance(int) and DocID() it means there are no more docs in the iterator.
 

Detailed Description

This abstract class defines methods to iterate over a set of non-decreasing doc ids. Note that this class assumes it iterates on doc Ids, and therefore NO_MORE_DOCS is set to Int32.MaxValue in order to be used as a sentinel object. Implementations of this class are expected to consider int.MaxValue as an invalid value.

Definition at line 27 of file DocIdSetIterator.cs.

Member Function Documentation

abstract int Lucene.Net.Search.DocIdSetIterator.Advance ( int  target)
pure virtual

Advances to the first beyond the current whose document number is greater than or equal to target. Returns the current document number or NO_MORE_DOCS if there are no more docs in the set. Behaves as if written:

int advance(int target) { int doc; while ((doc = nextDoc()) < target) { } return doc; }

Some implementations are considerably more efficient than that.

NOTE: certain implemenations may return a different value (each time) if called several times in a row with the same target.

NOTE: this method may be called with NO_MORE_DOCS for efficiency by some Scorers. If your implementation cannot efficiently determine that it should exhaust, it is recommended that you check for that value in each call to this method.

NOTE: after the iterator has exhausted you should not call this method, as it may result in unpredicted behavior.

<since>2.9</since>

Implemented in Lucene.Net.Spatial.Util.FixedBitSet.FixedBitSetIterator, Lucene.Net.Search.BooleanScorer2, Lucene.Net.Search.BooleanScorer, Lucene.Net.Search.DisjunctionSumScorer, Lucene.Net.Spatial.Util.FunctionQuery.AllScorer, Lucene.Net.Search.TermScorer, Lucene.Net.Search.PhraseScorer, Lucene.Net.Search.ReqExclScorer, Lucene.Net.Search.DisjunctionMaxScorer, Lucene.Net.Search.ConjunctionScorer, Lucene.Net.Search.ScoreCachingWrappingScorer, Lucene.Net.Search.FilteredDocIdSetIterator, Lucene.Net.Search.Spans.SpanScorer, Lucene.Net.Search.DocIdSet.AnonymousClassDocIdSet.AnonymousClassDocIdSetIterator, and Lucene.Net.Search.ReqOptSumScorer.

abstract int Lucene.Net.Search.DocIdSetIterator.DocID ( )
pure virtual
abstract int Lucene.Net.Search.DocIdSetIterator.NextDoc ( )
pure virtual

Member Data Documentation

readonly int Lucene.Net.Search.DocIdSetIterator.NO_MORE_DOCS = System.Int32.MaxValue
static

When returned by NextDoc(), Advance(int) and DocID() it means there are no more docs in the iterator.

Definition at line 34 of file DocIdSetIterator.cs.


The documentation for this class was generated from the following file: