当前位置: 首页>>代码示例>>C#>>正文


C# OpenBitSet.FastGet方法代码示例

本文整理汇总了C#中Lucene.Net.Util.OpenBitSet.FastGet方法的典型用法代码示例。如果您正苦于以下问题:C# OpenBitSet.FastGet方法的具体用法?C# OpenBitSet.FastGet怎么用?C# OpenBitSet.FastGet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Lucene.Net.Util.OpenBitSet的用法示例。


在下文中一共展示了OpenBitSet.FastGet方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FindValues

 public override sealed int FindValues(OpenBitSet bitset, int docId, int maxId)
 {
     while (docId <= maxId && !bitset.FastGet(array[docId >> SHIFT_SIZE][docId & MASK]))
     {
         docId++;
     }
     return docId;
 }
开发者ID:NightOwl888,项目名称:Bobo-Browse.Net,代码行数:8,代码来源:BigByteArray.cs

示例2: FindValues

 public override int FindValues(OpenBitSet bitset, int docId, int maxId)
 {
     while (docId <= maxId && !bitset.FastGet(array[docId >> SHIFT_SIZE][docId & MASK]))
     {
         docId++;
     }
     return docId > maxId ? DocIdSetIterator.NO_MORE_DOCS : docId;
 }
开发者ID:NightOwl888,项目名称:Bobo-Browse.Net,代码行数:8,代码来源:BigIntArray.cs

示例3: FindValues

 public override sealed int FindValues(OpenBitSet bitset, int docId, int maxId)
 {
     while (true)
     {
         if (bitset.FastGet(_array[docId >> SHIFT_SIZE][docId & MASK])) return docId;
         if (docId++ >= maxId) break;
     }
     return DocIdSetIterator.NO_MORE_DOCS;
 }
开发者ID:yao-yi,项目名称:BoboBrowse.Net,代码行数:9,代码来源:BigShortArray.cs

示例4: FindValues

 /// <summary>
 /// (non-Javadoc)
 /// see com.browseengine.bobo.util.BigSegmentedArray#findValues(org.apache.lucene.util.OpenBitSet, int, int)
 /// </summary>
 /// <param name="bitset"></param>
 /// <param name="id"></param>
 /// <param name="maxId"></param>
 /// <returns></returns>
 public override int FindValues(OpenBitSet bitset, int id, int maxId)
 {
     while (id <= maxId)
     {
         int i = id >> SHIFT_SIZE;
         if (_array[i] == null)
         {
             if (bitset.FastGet(_fillValue))
                 return id;
             else
                 id = (i + 1) << SHIFT_SIZE; // jump to next segment
         }
         else
         {
             if (bitset.FastGet(_array[i][id & MASK]))
                 return id;
             else
                 id++;
         }
     }
     return DocIdSetIterator.NO_MORE_DOCS;
 }
开发者ID:modulexcite,项目名称:BoboBrowse.Net,代码行数:30,代码来源:LazyBigIntArray.cs

示例5: FindValues

        public int FindValues(OpenBitSet values, int id, int maxID, bool withMissing)
        {
            // NOTE: Added Get() extension method call because 
            // the default .NET behavior throws an exception if the
            // index is out of bounds, rather than returning null.
            int[] page = _list.Get(id >> PAGEID_SHIFT);
            if (page == null) page = MISSING_PAGE;

            while (true)
            {
                int val = page[id & SLOTID_MASK];
                if (val >= 0)
                {
                    if (values.FastGet(val)) return id;
                }
                else if (val != MISSING)
                {
                    int idx = -(val >> VALIDX_SHIFT);// signed shift, remember this is a negative number
                    int end = idx + (val & COUNT_MASK);
                    while (idx < end)
                    {
                        if (values.FastGet(page[idx++])) return id;
                    }
                }
                else if (withMissing)
                {
                    if (values.FastGet(0)) return id;
                }
                if (id >= maxID) break;

                if ((++id & SLOTID_MASK) == 0)
                {
                    // NOTE: Added Get() extension method call because 
                    // the default .NET behavior throws an exception if the
                    // index is out of bounds, rather than returning null.
                    page = _list.Get(id >> PAGEID_SHIFT);
                    if (page == null) page = MISSING_PAGE;
                }
            }

            return DocIdSetIterator.NO_MORE_DOCS;
        }
开发者ID:yao-yi,项目名称:BoboBrowse.Net,代码行数:42,代码来源:BigNestedIntArray.cs

示例6: Contains

        public bool Contains(int id, OpenBitSet values)
        {
            // NOTE: Added Get() extension method call because 
            // the default .NET behavior throws an exception if the
            // index is out of bounds, rather than returning null.
            int[] page = _list.Get(id >> PAGEID_SHIFT);
            if (page == null) return false;

            int val = page[id & SLOTID_MASK];
            if (val >= 0)
            {
                return (values.FastGet(val));
            }
            else if (val != MISSING)
            {
                int idx = -(val >> VALIDX_SHIFT); // signed shift, remember this is a negative number
                int end = idx + (val & COUNT_MASK);
                while (idx < end)
                {
                    if (values.FastGet(page[idx++])) return true;
                }
            }
            return false;
        }
开发者ID:yao-yi,项目名称:BoboBrowse.Net,代码行数:24,代码来源:BigNestedIntArray.cs

示例7: CountNoReturnWithFilter

        public void CountNoReturnWithFilter(int id, BigSegmentedArray count, OpenBitSet filter)
        {
            int[] page = _list[id >> PAGEID_SHIFT];
            if (page == null)
            {
                count.Add(0, count.Get(0) + 1);
                return;
            }

            int val = page[id & SLOTID_MASK];
            if (val >= 0)
            {
                if (filter.FastGet(val))
                {
                    count.Add(val, count.Get(val) + 1);
                }
                return;
            }
            else if (val != MISSING)
            {
                int idx = -(val >> VALIDX_SHIFT); // signed shift, remember val is a negative number
                int cnt = (val & COUNT_MASK);
                int end = idx + cnt;
                while (idx < end)
                {
                    int value = page[idx++];
                    if (filter.FastGet(value))
                    {
                        count.Add(value, count.Get(value) + 1);
                    }
                }
                return;
            }
            count.Add(0, count.Get(0) + 1);
            return;
        }
开发者ID:yao-yi,项目名称:BoboBrowse.Net,代码行数:36,代码来源:BigNestedIntArray.cs

示例8: Contains

        public bool Contains(int id, OpenBitSet values)
        {
            int[] page = _list[id >> PAGEID_SHIFT];
            if (page == null)
                return false;

            int val = page[id & SLOTID_MASK];
            if (val >= 0)
            {
                return (values.FastGet(val));
            }
            else if (val != MISSING)
            {
                int idx = -(val >> VALIDX_SHIFT); // signed shift, remember this is a negative number
                int end = idx + (val & COUNT_MASK);
                while (idx < end)
                {
                    if (values.FastGet(page[idx++]))
                        return true;
                }
            }
            return false;
        }
开发者ID:NightOwl888,项目名称:Bobo-Browse.Net,代码行数:23,代码来源:BigNestedIntArray.cs

示例9: FacetOrDocIdSetIterator

            public FacetOrDocIdSetIterator(FacetDataCache dataCache, OpenBitSet bitset)
            {
                _dataCache = dataCache;
                _orderArray = dataCache.OrderArray;
                _bitset = bitset;

                _doc = int.MaxValue;
                _maxID = -1;
                int size = _dataCache.ValArray.Count;
                for (int i = 0; i < size; ++i)
                {
                    if (!bitset.FastGet(i))
                    {
                        continue;
                    }
                    if (_doc > _dataCache.MinIDs[i])
                    {
                        _doc = _dataCache.MinIDs[i];
                    }
                    if (_maxID < _dataCache.MaxIDs[i])
                    {
                        _maxID = _dataCache.MaxIDs[i];
                    }
                }
                _doc--;
                if (_doc < 0)
                    _doc = -1;
            }
开发者ID:modulexcite,项目名称:BoboBrowse.Net,代码行数:28,代码来源:FacetOrFilter.cs


注:本文中的Lucene.Net.Util.OpenBitSet.FastGet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。