コード例 #1
0
            public int NextDoc()
            {
                if (Idx >= Size)
                {
                    Offset = -1;
                    return(Doc_Renamed = DocIdSetIterator.NO_MORE_DOCS);
                }
                Doc_Renamed = (int)Docs.Get(Idx);
                ++Idx;
                while (Idx < Size && Docs.Get(Idx) == Doc_Renamed)
                {
                    ++Idx;
                }
                // idx points to the "next" element
                long prevIdx = Idx - 1;

                if (!DocsWithField.Get((int)prevIdx))
                {
                    Offset = -1;
                }
                else
                {
                    // cannot change 'value' here because nextDoc is called before the
                    // value is used, and it's a waste to clone the BytesRef when we
                    // obtain the value
                    Offset = (int)Offsets.Get(prevIdx);
                    Length = (int)Lengths.Get(prevIdx);
                }
                return(Doc_Renamed);
            }
コード例 #2
0
            protected override void Swap(int i, int j)
            {
                long tmpDoc = docs.Get(j);

                docs.Set(j, docs.Get(i));
                docs.Set(i, tmpDoc);

                long tmpVal = values.Get(j);

                values.Set(j, values.Get(i));
                values.Set(i, tmpVal);

                bool tmpBool = docsWithField.Get(j);

                if (docsWithField.Get(i))
                {
                    docsWithField.Set(j);
                }
                else
                {
                    docsWithField.Clear(j);
                }
                if (tmpBool)
                {
                    docsWithField.Set(i);
                }
                else
                {
                    docsWithField.Clear(i);
                }
            }
コード例 #3
0
            public override int NextDoc()
            {
                if (idx >= size)
                {
                    offset = -1;
                    return(doc = DocIdSetIterator.NO_MORE_DOCS);
                }
                doc = (int)docs.Get(idx);
                ++idx;
                while (idx < size && docs.Get(idx) == doc)
                {
                    ++idx;
                }
                // idx points to the "next" element
                long prevIdx = idx - 1;

                if (!docsWithField.Get((int)prevIdx))
                {
                    offset = -1;
                }
                else
                {
                    // cannot change 'value' here because nextDoc is called before the
                    // value is used, and it's a waste to clone the BytesRef when we
                    // obtain the value
                    offset = (int)offsets.Get(prevIdx);
                    length = (int)lengths.Get(prevIdx);
                }
                return(doc);
            }
コード例 #4
0
            protected internal override void Swap(int i, int j)
            {
                long tmpDoc = Docs.Get(j);

                Docs.Set(j, Docs.Get(i));
                Docs.Set(i, tmpDoc);

                long tmpVal = Values.Get(j);

                Values.Set(j, Values.Get(i));
                Values.Set(i, tmpVal);

                bool tmpBool = DocsWithField.Get(j);

                if (DocsWithField.Get(i))
                {
                    DocsWithField.Set(j);
                }
                else
                {
                    DocsWithField.Clear(j);
                }
                if (tmpBool)
                {
                    DocsWithField.Set(i);
                }
                else
                {
                    DocsWithField.Clear(i);
                }
            }
コード例 #5
0
 public override int NextDoc()
 {
     if (idx >= size)
     {
         value = null;
         return(doc = DocIdSetIterator.NO_MORE_DOCS);
     }
     doc = (int)docs.Get(idx);
     ++idx;
     while (idx < size && docs.Get(idx) == doc)
     {
         ++idx;
     }
     if (!docsWithField.Get((int)(idx - 1)))
     {
         value = null;
     }
     else
     {
         // idx points to the "next" element
         value = Convert.ToInt64(values.Get(idx - 1));
     }
     return(doc);
 }
コード例 #6
0
            protected override void Swap(int i, int j)
            {
                long tmpDoc = Docs.Get(j);

                Docs.Set(j, Docs.Get(i));
                Docs.Set(i, tmpDoc);

                long tmpOffset = Offsets.Get(j);

                Offsets.Set(j, Offsets.Get(i));
                Offsets.Set(i, tmpOffset);

                long tmpLength = Lengths.Get(j);

                Lengths.Set(j, Lengths.Get(i));
                Lengths.Set(i, tmpLength);

                bool tmpBool = DocsWithField.Get(j);

                if (DocsWithField.Get(i))
                {
                    DocsWithField.Set(j);
                }
                else
                {
                    DocsWithField.Clear(j);
                }
                if (tmpBool)
                {
                    DocsWithField.Set(i);
                }
                else
                {
                    DocsWithField.Clear(i);
                }
            }
コード例 #7
0
            protected override void Swap(int i, int j)
            {
                long tmpDoc = docs.Get(j);

                docs.Set(j, docs.Get(i));
                docs.Set(i, tmpDoc);

                long tmpOffset = offsets.Get(j);

                offsets.Set(j, offsets.Get(i));
                offsets.Set(i, tmpOffset);

                long tmpLength = lengths.Get(j);

                lengths.Set(j, lengths.Get(i));
                lengths.Set(i, tmpLength);

                bool tmpBool = docsWithField.Get(j);

                if (docsWithField.Get(i))
                {
                    docsWithField.Set(j);
                }
                else
                {
                    docsWithField.Clear(j);
                }
                if (tmpBool)
                {
                    docsWithField.Set(i);
                }
                else
                {
                    docsWithField.Clear(i);
                }
            }
コード例 #8
0
 public int NextDoc()
 {
     if (Idx >= Size)
     {
         Value_Renamed = null;
         return(Doc_Renamed = DocIdSetIterator.NO_MORE_DOCS);
     }
     Doc_Renamed = (int)Docs.Get(Idx);
     ++Idx;
     while (Idx < Size && Docs.Get(Idx) == Doc_Renamed)
     {
         ++Idx;
     }
     if (!DocsWithField.Get((int)(Idx - 1)))
     {
         Value_Renamed = null;
     }
     else
     {
         // idx points to the "next" element
         Value_Renamed = Convert.ToInt64(Values.Get(Idx - 1));
     }
     return(Doc_Renamed);
 }