Files
spark/src/DataStreamSuite/DataStreamCore/BlueData/BlueRowEnumerator.cs
T
2023-09-04 16:25:40 -04:00

38 lines
943 B
C#

using System;
using System.Collections;
namespace BCG
{
/// <summary>
/// Used for enumerating an IEnumerable (ex ICollection). Furthermore, this is the
/// default Enueramtor used when enumerating asn IBlueRow
/// </summary>
public class BlueRowEnumerator : IEnumerator
{
protected int myPos = -1;
protected int myRowSize = -1;
protected IBlueRow myRow;
public BlueRowEnumerator (IBlueRow row)
{
myRow = row;
myRowSize = row.schema.columnNames.Length;
}
#region IEnumerator members
public void Reset() {myPos = 0;}
public bool MoveNext ()
{
if (myPos == myRowSize - 1)
return false;
myPos ++;
return true;
}
public virtual object Current {get{return myRow[myPos];}}
#endregion
}
}