Esempio n. 1
0
            public override bool SkipTo(int target)
            {
                if (moreInclude)
                {
                    // skip include
                    moreInclude = includeSpans.SkipTo(target);
                }

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

                if (moreExclude && includeSpans.Doc() > excludeSpans.Doc())
                {
                    moreExclude = excludeSpans.SkipTo(includeSpans.Doc());
                }

                while (moreExclude && includeSpans.Doc() == excludeSpans.Doc() && excludeSpans.End() <= includeSpans.Start())
                {
                    moreExclude = excludeSpans.Next();                     // increment exclude
                }

                if (!moreExclude || includeSpans.Doc() != excludeSpans.Doc() || includeSpans.End() <= excludeSpans.Start())
                {
                    return(true);              // we found a match
                }
                return(Next());                // scan to next match
            }
Esempio n. 2
0
            public override bool SkipTo(int target)
            {
                if (!spans.SkipTo(target))
                {
                    return(false);
                }

                return(spans.End() <= Enclosing_Instance.end || Next());
            }
Esempio n. 3
0
 private bool InitSpanQueue(int target)
 {
     queue = new SpanQueue(enclosingInstance, Enclosing_Instance.clauses.Count);
     System.Collections.IEnumerator i = Enclosing_Instance.clauses.GetEnumerator();
     while (i.MoveNext())
     {
         Spans spans = ((SpanQuery)i.Current).GetSpans(reader);
         if (((target == -1) && spans.Next()) || ((target != -1) && spans.SkipTo(target)))
         {
             queue.Put(spans);
         }
     }
     return(queue.Size() != 0);
 }
Esempio n. 4
0
 public override int Advance(int target)
 {
     if (!more)
     {
         return(doc = NO_MORE_DOCS);
     }
     if (spans.Doc() < target)
     {
         // setFreqCurrentDoc() leaves spans.doc() ahead
         more = spans.SkipTo(target);
     }
     if (!SetFreqCurrentDoc())
     {
         doc = NO_MORE_DOCS;
     }
     return(doc);
 }
Esempio n. 5
0
 public override bool SkipTo(int target)
 {
     return(Adjust(spans.SkipTo(target)));
 }