/// <summary>
 /// (non-Javadoc)
 /// see java.util.Iterator#next()
 /// </summary>
 /// <returns></returns>
 public override string Next()
 {
     _index++;
     facet = Convert.ToString(_valList.GetRawValue(_index));
     count = _count.Get(_index);
     return(Format(facet));
 }
        /// <summary>
        /// gets distribution of the value arrays. When predefined ranges are available, this returns distribution by predefined ranges.
        /// </summary>
        /// <returns></returns>
        public virtual BigSegmentedArray GetCountDistribution()
        {
            BigSegmentedArray dist = null;

            if (_predefinedRangeIndexes != null)
            {
                dist = new LazyBigIntArray(_predefinedRangeIndexes.Length);
                int n = 0;
                foreach (int[] range in _predefinedRangeIndexes)
                {
                    int start = range[0];
                    int end   = range[1];

                    int sum = 0;
                    for (int i = start; i < end; ++i)
                    {
                        sum += _count.Get(i);
                    }
                    dist.Add(n++, sum);
                }
            }
            else
            {
                dist = _count;
            }

            return(dist);
        }
Example #3
0
        public virtual BrowseFacet GetFacet(string value)
        {
            if (m_closed)
            {
                throw new InvalidOperationException("This instance of count collector for " + m_name + " was already closed");
            }
            BrowseFacet facet = null;
            int         index = m_dataCache.ValArray.IndexOf(value);

            if (index >= 0)
            {
                facet = new BrowseFacet(m_dataCache.ValArray.Get(index), m_count.Get(index));
            }
            else
            {
                facet = new BrowseFacet(m_dataCache.ValArray.Format(@value), 0);
            }
            return(facet);
        }
 /// <summary>
 /// (non-Javadoc)
 /// see java.util.Iterator#next()
 /// </summary>
 /// <returns></returns>
 public override string Next()
 {
     if ((m_index >= 0) && (m_index >= m_countLengthMinusOne))
     {
         throw new IndexOutOfRangeException("No more facets in this iteration");
     }
     m_index++;
     m_facet      = m_valList.GetPrimitiveValue(m_index);
     base.m_count = _count.Get(m_index);
     return(m_valList.Get(m_index));
 }
Example #5
0
            public override sealed void Collect(int docid)
            {
                int encoded = _array.Get(docid);

                if (encoded == 0)
                {
                    _noValCount++;
                }
                else
                {
                    int offset = 0;
                    while (true)
                    {
                        _combinationCount[(encoded & 0x0F) + offset]++;
                        encoded = (int)(((uint)encoded) >> 4);
                        if (encoded == 0)
                        {
                            break;
                        }
                        offset += 16;
                    }
                }
            }