Lucene.Net.Util.LuceneTestCase.DumpIterator C# (CSharp) Méthode

DumpIterator() public static méthode

Convenience method for logging an iterator.
public static DumpIterator ( string label, System iter, TextWriter stream ) : void
label string String logged before/after the items in the iterator
iter System Each next() is toString()ed and logged on it's own line. If iter is null this is logged differnetly then an empty iterator.
stream System.IO.TextWriter Stream to log messages to.
Résultat void
        public static void DumpIterator(string label, System.Collections.IEnumerator iter, TextWriter stream)
        {
            stream.WriteLine("*** BEGIN " + label + " ***");
            if (null == iter)
            {
                stream.WriteLine(" ... NULL ...");
            }
            else
            {
                while (iter.MoveNext())
                {
                    stream.WriteLine(iter.Current.ToString());
                }
            }
            stream.WriteLine("*** END " + label + " ***");
        }