Exemplo n.º 1
0
        /// <summary>
        /// (non-Javadoc)
        /// see com.browseengine.bobo.api.FacetIterator#next()
        /// </summary>
        /// <returns></returns>
        public override string Next()
        {
            if (!HasNext())
            {
                throw new IndexOutOfRangeException("No more facets in this iteration");
            }

            ShortIteratorNode node = _queue.Top();

            _facet = node.CurFacet;
            int next = TermShortList.VALUE_MISSING;

            count = 0;
            while (HasNext())
            {
                node = _queue.Top();
                next = node.CurFacet;
                if ((next != TermShortList.VALUE_MISSING) && (next != _facet))
                {
                    return(Format(_facet));
                }
                count += node.CurFacetCount;
                if (node.Fetch(1))
                {
                    _queue.UpdateTop();
                }
                else
                {
                    _queue.Pop();
                }
            }
            return(null);
        }