Exemple #1
0
            public virtual bool Next()
            {
                if (firstTime)
                {
                    // first time -- initialize
                    for (int i = 0; i < all.Count; i++)
                    {
                        Spans spans = (Spans)all[i];
                        if (spans.Next())
                        {
                            // move to first entry
                            queue.Put(spans);                             // build queue
                        }
                        else
                        {
                            all.RemoveAt(i--);
                        }
                    }
                    firstTime = false;
                    return(queue.Size() != 0);
                }

                if (queue.Size() == 0)
                {
                    // all done
                    return(false);
                }

                if (Top().Next())
                {
                    // move to next
                    queue.AdjustTop();
                    return(true);
                }

                all.Remove(queue.Pop());                 // exhausted a clause

                return(queue.Size() != 0);
            }
            public virtual bool Next()
            {
                if (queue == null)
                {
                    return(InitSpanQueue(-1));
                }

                if (queue.Size() == 0)
                {
                    // all done
                    return(false);
                }

                if (Top().Next())
                {
                    // move to next
                    queue.AdjustTop();
                    return(true);
                }

                queue.Pop();                 // exhausted a clause
                return(queue.Size() != 0);
            }