Esempio n. 1
0
        public override bool Next()
        {
            if (firstTime)
            {
                InitList(true);
                ListToQueue(); // initialize queue
                firstTime = false;
            }
            else if (more)
            {
                if (Min.Next())        // trigger further scanning
                {
                    queue.UpdateTop(); // maintain queue
                }
                else
                {
                    more = false;
                }
            }

            while (more)
            {
                bool queueStale = false;

                if (Min.Doc != max.Doc) // maintain list
                {
                    QueueToList();
                    queueStale = true;
                }

                // skip to doc w/ all clauses

                while (more && first.Doc < last.Doc)
                {
                    more = first.SkipTo(last.Doc); // skip first upto last
                    FirstToLast();                 // and move it to the end
                    queueStale = true;
                }

                if (!more)
                {
                    return(false);
                }

                // found doc w/ all clauses

                if (queueStale) // maintain the queue
                {
                    ListToQueue();
                    queueStale = false;
                }

                if (AtMatch)
                {
                    return(true);
                }

                more = Min.Next();
                if (more)
                {
                    queue.UpdateTop(); // maintain queue
                }
            }
            return(false); // no more matches
        }
Esempio n. 2
0
        public override bool Next()
        {
            if (FirstTime)
            {
                InitList(true);
                ListToQueue(); // initialize queue
                FirstTime = false;
            }
            else if (More)
            {
                if (Min().Next())      // trigger further scanning
                {
                    Queue.UpdateTop(); // maintain queue
                }
                else
                {
                    More = false;
                }
            }

            while (More)
            {
                bool queueStale = false;

                if (Min().Doc() != Max.Doc()) // maintain list
                {
                    QueueToList();
                    queueStale = true;
                }

                // skip to doc w/ all clauses

                while (More && First.Doc() < Last.Doc())
                {
                    More = First.SkipTo(Last.Doc()); // skip first upto last
                    FirstToLast();                   // and move it to the end
                    queueStale = true;
                }

                if (!More)
                {
                    return(false);
                }

                // found doc w/ all clauses

                if (queueStale) // maintain the queue
                {
                    ListToQueue();
                    queueStale = false;
                }

                if (AtMatch())
                {
                    return(true);
                }

                More = Min().Next();
                if (More)
                {
                    Queue.UpdateTop(); // maintain queue
                }
            }
            return(false); // no more matches
        }
Esempio n. 3
0
        public override bool MoveNext()
        {
            if (firstTime)
            {
                InitList(true);
                ListToQueue(); // initialize queue
                firstTime = false;
            }
            else if (more)
            {
                if (Min.MoveNext())    // trigger further scanning
                {
                    queue.UpdateTop(); // maintain queue
                }
                else
                {
                    more = false;
                }
            }

            while (more)
            {
                bool queueStale = false;

                if (Min.Doc != max.Doc) // maintain list
                {
                    QueueToList();
                    queueStale = true;
                }

                // skip to doc w/ all clauses

                while (more && first.Doc < last.Doc)
                {
                    more = first.SkipTo(last.Doc); // skip first upto last
                    FirstToLast();                 // and move it to the end
                    queueStale = true;
                }

                if (!more)
                {
                    return(false);
                }

                // found doc w/ all clauses

                if (queueStale) // maintain the queue
                {
                    ListToQueue();
                    //queueStale = false; // LUCENENET: IDE0059: Remove unnecessary value assignment (this is reset to false at the beginning of the loop)
                }

                if (AtMatch)
                {
                    return(true);
                }

                more = Min.MoveNext();
                if (more)
                {
                    queue.UpdateTop(); // maintain queue
                }
            }
            return(false); // no more matches
        }