Lucene.Net.Search.Suggest.UnsortedInputIterator.UnsortedInputIterator C# (CSharp) Method

UnsortedInputIterator() public method

Creates a new iterator, wrapping the specified iterator and returning elements in a random order.
public UnsortedInputIterator ( IInputIterator source ) : Lucene.Net.Util
source IInputIterator
return Lucene.Net.Util
        public UnsortedInputIterator(IInputIterator source)
            : base(source)
        {
            ords = new int[entries.Size()];
            Random random = new Random();
            for (int i = 0; i < ords.Length; i++)
            {
                ords[i] = i;
            }
            for (int i = 0; i < ords.Length; i++)
            {
                int randomPosition = random.Next(ords.Length);
                int temp = ords[i];
                ords[i] = ords[randomPosition];
                ords[randomPosition] = temp;
            }
        }
UnsortedInputIterator