public override int NextDoc()
{
Debug.Assert(State != DocsEnumState.FINISHED, "nextDoc() called after NO_MORE_DOCS");
int nextDoc = base.NextDoc();
Debug.Assert(nextDoc > Doc, "backwards nextDoc from " + Doc + " to " + nextDoc);
PositionCount = 0;
if (nextDoc == DocIdSetIterator.NO_MORE_DOCS)
{
State = DocsEnumState.FINISHED;
PositionMax = 0;
}
else
{
State = DocsEnumState.ITERATING;
PositionMax = base.Freq();
}
Debug.Assert(base.DocID() == nextDoc);
return Doc = nextDoc;
}