Exemplo n.º 1
0
        // TODO: Remove warning after API has been finalized

        /// <summary> WARNING: The List is not necessarily in order of the the positions</summary>
        /// <returns> Collection of &amp;lt;c&amp;gt;byte[]&amp;lt;/c&amp;gt; payloads </returns>
        /// <throws>  IOException </throws>
        public override ICollection <byte[]> GetPayload()
        {
            System.Collections.Generic.ISet <byte[]> matchPayload = Lucene.Net.Support.Compatibility.SetFactory.CreateHashSet <byte[]>();
            for (SpansCell cell = first; cell != null; cell = cell.next)
            {
                if (cell.IsPayloadAvailable())
                {
                    matchPayload.UnionWith(cell.GetPayload());
                }
            }
            return(matchPayload);
        }
        public bool IsPayloadAvailable()
        {
            SpansCell pointer = Min();

            while (pointer != null)
            {
                if (pointer.IsPayloadAvailable())
                {
                    return(true);
                }
                pointer = pointer.next;
            }
            return(false);
        }
        public ICollection <byte[]> GetPayload()
        {
            Dictionary <byte[], byte[]> matchPayload = new Dictionary <byte[], byte[]>();

            for (SpansCell cell = first; cell != null; cell = cell.next)
            {
                if (cell.IsPayloadAvailable())
                {
                    for (IEnumerator <byte[]> e = cell.GetPayload().GetEnumerator(); e.MoveNext();)
                    {
                        matchPayload[e.Current] = e.Current;
                    }
                }
            }
            return(matchPayload.Keys);
        }
Exemplo n.º 4
0
 // TODO: Remove warning after API has been finalized
 /// <summary> WARNING: The List is not necessarily in order of the the positions</summary>
 /// <returns> Collection of <code>byte[]</code> payloads
 /// </returns>
 /// <throws>  IOException </throws>
 public override System.Collections.Generic.ICollection <byte[]> GetPayload()
 {
     //mgarski: faking out another HashSet<T>...
     System.Collections.Generic.Dictionary <byte[], byte[]> matchPayload = new System.Collections.Generic.Dictionary <byte[], byte[]>();
     for (SpansCell cell = first; cell != null; cell = cell.next)
     {
         if (cell.IsPayloadAvailable())
         {
             System.Collections.Generic.ICollection <byte[]> cellPayload = cell.GetPayload();
             foreach (byte[] val in cellPayload)
             {
                 if (!matchPayload.ContainsKey(val))
                 {
                     matchPayload.Add(val, val);
                 }
             }
         }
     }
     return(matchPayload.Keys);
 }