Class ForwardFusion<T1, T2>
- Namespace
- Utils.Collections
- Assembly
- Utils.dll
Merges two sorted IEnumerable<T> collections based on the specified join type. The left list is considered the primary list in a left join, and vice versa for a right join.
public class ForwardFusion<T1, T2> : IEnumerable<(T1 Left, T2 Right)>, IEnumerable, IDisposable
Type Parameters
T1The type of elements in the left list.
T2The type of elements in the right list.
- Inheritance
-
ForwardFusion<T1, T2>
- Implements
- Inherited Members
- Extension Methods
Constructors
ForwardFusion(IEnumerable<T1>, IEnumerable<T2>, IComparer, JoinType)
Initializes a new instance of the ForwardFusion<T1, T2> class using a custom comparer to compare elements in the lists.
public ForwardFusion(IEnumerable<T1> leftList, IEnumerable<T2> rightList, IComparer comparer, JoinType joinType = JoinType.InnerJoin)
Parameters
leftListIEnumerable<T1>The left list, which is considered the primary list.
rightListIEnumerable<T2>The right list.
comparerIComparerThe comparer used to compare elements in the lists.
joinTypeJoinTypeThe type of join to perform.
ForwardFusion(IEnumerable<T1>, IEnumerable<T2>, Func<T1, T2, int>, JoinType)
Initializes a new instance of the ForwardFusion<T1, T2> class using a custom comparison function.
public ForwardFusion(IEnumerable<T1> leftList, IEnumerable<T2> rightList, Func<T1, T2, int> compare, JoinType joinType = JoinType.InnerJoin)
Parameters
leftListIEnumerable<T1>The left list, which is considered the primary list.
rightListIEnumerable<T2>The right list.
compareFunc<T1, T2, int>The comparison function used to compare elements in the lists.
joinTypeJoinTypeThe type of join to perform.
ForwardFusion(IEnumerable<T1>, IEnumerable<T2>, JoinType)
Initializes a new instance of the ForwardFusion<T1, T2> class. This constructor automatically determines the comparison logic based on the types of T1 and T2.
public ForwardFusion(IEnumerable<T1> leftList, IEnumerable<T2> rightList, JoinType joinType = JoinType.InnerJoin)
Parameters
leftListIEnumerable<T1>The left list, which is considered the primary list.
rightListIEnumerable<T2>The right list.
joinTypeJoinTypeThe type of join to perform.
Methods
Dispose()
Disposes of the resources used by the ForwardFusion class.
public void Dispose()
Dispose(bool)
Disposes managed resources if disposing is true.
protected virtual void Dispose(bool disposing)
Parameters
disposingboolIndicates whether to dispose managed resources.
GetEnumerator()
Returns an enumerator that iterates through the merged lists.
public IEnumerator<(T1 Left, T2 Right)> GetEnumerator()
Returns
- IEnumerator<(T1 Left, T2 Right)>