本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}