Files
spark/src/DataStreamSuite/DataStream/Primitives/LightJoinStreams/LightForeignJoinSimpleCollection.cs
T

66 lines
1.7 KiB
C#

using System;
using System.Collections;
namespace BCG
{
/// <summary>
/// A simple implementation of IBlueRowCollection which allows for the ImmutableBlueTable to contruct
/// itself from iterating through this class. The property 'schema' and the GetEnumerator are the
/// only 2 members that need implementation. This collection is used for the addedRows and deletedRows
/// </summary>
public class LightForeignJoinSimpleCollection : IBlueRowCollection
{
private IBlueTableSchema mySchema;
private ArrayList myRows = new ArrayList ();
public LightForeignJoinSimpleCollection (IBlueTableSchema schema) {mySchema = schema;}
public LightForeignJoinSimpleCollection (IBlueRowCollection rows)
: this (rows.schema)
{
foreach (IBlueRow r in rows)
addRow (r);
}
public void addRow (IBlueRow r)
{
myRows.Add (r);
}
public void addRow (IBlueRowCollection rs)
{
foreach (IBlueRow r in rs)
addRow (r);
}
#region IBlueRowCollection Members
public IBlueRow this[int id] {get{throw new NotSupportedException ("");}}
public bool containsID (int id) {throw new NotSupportedException ("");}
public IBlueTableSchema schema {get {return mySchema;}}
#endregion
#region ICollection Members
public bool IsSynchronized {get {return false;}}
public int Count {get {return myRows.Count;}}
public void CopyTo (Array array, int index) {throw new NotSupportedException ("");}
public object SyncRoot => this;
#endregion
#region IEnumerable Members
public IEnumerator GetEnumerator() {return myRows.GetEnumerator ();}
#endregion
}
}